当前位置: 首页>>代码示例>>C#>>正文


C# MapType.reserveTile方法代码示例

本文整理汇总了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";
        }
    }
开发者ID:taoketao,项目名称:PBA4_sourcetree,代码行数:44,代码来源:MovePkmn.cs


注:本文中的MapType.reserveTile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。