本文整理汇总了C#中Grid.GetComponent方法的典型用法代码示例。如果您正苦于以下问题:C# Grid.GetComponent方法的具体用法?C# Grid.GetComponent怎么用?C# Grid.GetComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Grid
的用法示例。
在下文中一共展示了Grid.GetComponent方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start()
{
tier = 1;
grid = GameObject.FindGameObjectWithTag ("Grid").GetComponent<Grid> ();
render = GetComponent<SpriteRenderer>();
selection = grid.GetComponent<SelectionManager> ();
}
示例2: MapRenderer
public MapRenderer()
{
tileSheetTiles = Resources.Load("download", typeof(Texture2D)) as Texture2D;
tileSheetShadows = Resources.Load("Shadows", typeof(Texture2D)) as Texture2D;
map = new GameObject("map").AddComponent<Grid>();
map.transform.position = new Vector3(-0.5F, -0.5F, 0);
map.GetComponent<MeshRenderer>().materials = new Material[] { Resources.Load("SpriteSheet", typeof(Material)) as Material };
shadows = new GameObject("shadows").AddComponent<Grid>();
shadows.gameObject.layer = LayerMask.NameToLayer("Shadows");
shadows.transform.position = new Vector3(-0.5F, -0.5F, -0.5F);
shadows.GetComponent<MeshRenderer>().materials = new Material[] { Resources.Load("ShadowsMaterial", typeof(Material)) as Material };
}
示例3: Start
// Use this for initialization
void Start()
{
//This will change as tier increases later
tier = 1;
infantryTime = 100;
cavalryTime = 200;
//Initialize the soldier queue
soldiers = new Queue ();
grid = GameObject.FindGameObjectWithTag ("Grid").GetComponent<Grid> ();
render = GetComponent<SpriteRenderer>();
selection = grid.GetComponent<SelectionManager> ();
health = GetComponentInChildren<Health> ();
cavalryDmg = 15; cavalryArmor = 5; cavalryHealth = 125;
infantryDmg = 10; infantryArmor = 0; infantryHealth = 100;
armorAval = false;attackAval = false;upgradeAval = false;
armorLevel = 1;attackLevel = 1;
}
示例4: Start
// Use this for initialization
void Start()
{
//This will change as tier increases later
tier = 1;
archerTime = 120;
//Initialize the soldier queue
soldiers = new Queue ();
grid = GameObject.FindGameObjectWithTag ("Grid").GetComponent<Grid> ();
render = GetComponent<SpriteRenderer>();
selection = grid.GetComponent<SelectionManager> ();
}
示例5: Awake
// Initialize the components of the infantry
void Awake()
{
grid = GameObject.FindGameObjectWithTag ("Grid").GetComponent<Grid> ();
render = GetComponent<SpriteRenderer>();
Selection = grid.GetComponent<SelectionManager> ();
cam = grid.transform.Find("Camera").GetComponent<Camera>();
body = GetComponent<Rigidbody2D>();
point = transform.position;
ordered = -1; //No order has ben given
pathOrdered = new Stack ();
target = null;
targetLoc = new Vector2 (0, 0);
targetSighted = new Vector2 (0, 0);
counter = 100;
awareness = 100;
}