本文整理汇总了C#中GameController.MakeSprite方法的典型用法代码示例。如果您正苦于以下问题:C# GameController.MakeSprite方法的具体用法?C# GameController.MakeSprite怎么用?C# GameController.MakeSprite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameController
的用法示例。
在下文中一共展示了GameController.MakeSprite方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: init
// Use this for initialization
public void init(GameController gCont, float x, float y)
{
controller = gCont;
model = new GameObject();
controller.MakeSprite (model, "Bar", transform, x, y, 1, 1, 200, .5f, 0);
model.GetComponent<SpriteRenderer> ().sortingLayerName = "BottomRhsUI";
model.transform.localPosition = new Vector3 (0, 0, 0);
mat = model.GetComponent<Renderer> ().material;
mat.color = new Color (0, .75f, 0);
GameObject outlineModel = new GameObject ();
controller.MakeSprite (outlineModel, "BarOutline", transform, 0, -.03f, 1, 1, 200, .5f, 0);
outlineModel.GetComponent<SpriteRenderer> ().sortingLayerName = "TopRhsUI";
health = 100;
print (health);
repairRate = 30f;
decaying = true;
initd = true;
}
示例2: init
// Use this for initialization
public void init(GameController gContr, float x, float y, float quadR, float quadG, float quadB)
{
controller = gContr;
healthBar = gameObject.transform.parent.FindChild("Health").GetComponent<ComponentHealth> ();
captain = GameObject.Find ("Crew").GetComponent<MoveCaptain> ();
healthBar = gameObject.transform.parent.FindChild ("Health").GetComponent<ComponentHealth> ();
controller.MakeSprite (gameObject, "Button", transform.parent, 0, 0, 1, 1, 300);
gameObject.name = "Button";
gameObject.GetComponent<SpriteRenderer> ().sortingLayerName = "BottomRhsUI";
gameObject.transform.localPosition = new Vector3 (x, y, 0);
gameObject.AddComponent<BoxCollider2D> ();
sprite = GetComponent<SpriteRenderer> ();
darkenSprite = (.7f);
upColor = new Color (quadR, quadG, quadB);
downColor = new Color (quadR*darkenSprite, quadG*darkenSprite, quadB*darkenSprite);
sprite.color = upColor;
}
示例3: init
// Use this for initialization
public void init(GameController gContr)
{
controller = gContr;
transform.localScale = new Vector3(1.3f, 1.3f, 1);
transform.position = new Vector3(3.4f, 0, 0);
lasers = new GameObject();
lasers.transform.parent = transform;
lasers.transform.localPosition = new Vector3 (0, 0, 0);
lasers.name = "Lasers";
lasers.transform.localScale = new Vector3 (1, 1, 1);
engines = new GameObject();
engines.transform.parent = transform;
engines.transform.localPosition = new Vector3 (0, 0, 0);
engines.name = "Engines";
engines.transform.localScale = new Vector3 (1, 1, 1);
shields = new GameObject();
shields.transform.parent = transform;
shields.transform.localPosition = new Vector3 (0, 0, 0);
shields.name = "Shields";
shields.transform.localScale = new Vector3 (1, 1, 1);
components = new GameObject[3]{ lasers, engines, shields };
cockpit = new GameObject ();
controller.MakeSprite (cockpit,"", this.transform, 0, 2.37f, 1, 1, 500);
cockpit.AddComponent<Animator> ();
Animator animator = cockpit.GetComponent<Animator> ();
animator.runtimeAnimatorController = Resources.Load<RuntimeAnimatorController> ("Animation/Cockpit_Animation_Controller");
cockpit.gameObject.GetComponent<SpriteRenderer> ().sortingLayerName = "Modules";
cockpit.name = "Cockpit";
engineModule = new GameObject ();
controller.MakeSprite (engineModule,"", this.transform, -1.085f, -1.664f, 1, 1, 500);
engineModule.AddComponent<Animator> ();
animator = engineModule.GetComponent<Animator> ();
animator.runtimeAnimatorController = Resources.Load<RuntimeAnimatorController> ("Animation/Engines_Animation_Controller");
engineModule.gameObject.GetComponent<SpriteRenderer> ().sortingLayerName = "Modules";
engineModule.name = "EngineModule";
shieldModule = new GameObject ();
controller.MakeSprite (shieldModule,"", this.transform, 1.085f, -2.15f, 1, 1, 500);
shieldModule.AddComponent<Animator> ();
animator = shieldModule.GetComponent<Animator> ();
animator.runtimeAnimatorController = Resources.Load<RuntimeAnimatorController> ("Animation/Shield_Animation_Controller");
shieldModule.gameObject.GetComponent<SpriteRenderer> ().sortingLayerName = "Modules";
shieldModule.name = "ShieldModule";
core = new GameObject ();
controller.MakeSprite (core,"", this.transform,0, -0.38f, 1, 1, 500);
core.AddComponent<Animator> ();
animator = core.GetComponent<Animator> ();
animator.runtimeAnimatorController = Resources.Load<RuntimeAnimatorController> ("Animation/Core_Animation_Controller");
core.gameObject.GetComponent<SpriteRenderer> ().sortingLayerName = "Border";
core.name = "Core";
hyperShield = new GameObject ();
controller.MakeSprite (hyperShield,"", this.transform, .225f, 0, 1, 1, 500);
hyperShield.AddComponent<Animator> ();
animator = hyperShield.GetComponent<Animator> ();
animator.runtimeAnimatorController = Resources.Load<RuntimeAnimatorController> ("Animation/Hyper_Shield_Animation_Controller");
hyperShield.gameObject.GetComponent<SpriteRenderer> ().sortingLayerName = "Player";
hyperShield.gameObject.GetComponent<SpriteRenderer> ().sortingOrder = 1;
hyperShield.name = "HyperShield";
hyperShield.gameObject.GetComponent<SpriteRenderer> ().enabled = false;
crew = new GameObject ();
crew.transform.parent = transform;
crew.AddComponent<MoveCaptain> ();
controller.MakeSprite (crew, "Button", transform, 0, -1.6f , .5f, .5f, 300);
crew.name = "Crew";
crew.GetComponent<MoveCaptain> ().init (controller, components);
}