本文整理汇总了C#中MapType.reserveTile方法的典型用法代码示例。如果您正苦于以下问题:C# MapType.reserveTile方法的具体用法?C# MapType.reserveTile怎么用?C# MapType.reserveTile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapType
的用法示例。
在下文中一共展示了MapType.reserveTile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: startMe
public void startMe(int _pkmn, GameObject myself, Vector3 curs_pos,
GameObject player)
{
whichAction = "HALT_INIT";
subactions = new Dictionary<string, float>();
envir_info = new Dictionary<string, float>();
envir_objects = new Dictionary<string, GameObject>();
init_pos = player.transform.position;
self_ref = myself;
image_ref = transform.Find("Image").gameObject;
player_ref = player;
map_ref = GameObject.FindGameObjectsWithTag("World_Map")[0];
maphandler_script = map_ref.GetComponent<MapHandler>();
maphandle = maphandler_script.Map;
player_action_script = player.GetComponent<ActionPlayer>();
player_coll = (CapsuleCollider)
player.GetComponentInChildren<CapsuleCollider>();
coll = (CapsuleCollider) GetComponent<Collider>();
pkmn = _pkmn;
image_rnd = image_ref.GetComponent<Renderer>();
default_image_scale = new Vector3(1.0f, 1.3f, 1.0f);
image_rnd.enabled = false;
if (magn(init_pos-curs_pos, false, 2) >
player_action_script.max_throw_dist) {
Debug.Log(init_pos.ToString()+" -> "+curs_pos.ToString()+
": Pokemon throwing distance too far.");
whichAction = "KILL";
return;
}
dirvecs.Add(new Vector3(0.0f,0.0f,maphandler_script.scale));
dirvecs.Add(new Vector3(maphandler_script.scale,0.0f,0.0f));
dirvecs.Add(new Vector3(0.0f,0.0f,-maphandler_script.scale));
dirvecs.Add(new Vector3(-maphandler_script.scale,0.0f,0.0f));
image_rnd.material.SetColor("_TintColor", Color.grey);
if (maphandle.reserveTile(curs_pos, self_ref)) {
initMe();
throwMe(player, curs_pos);
} else {
whichAction = "KILL";
}
}