コード例 #1
0
    /// <summary>
    /// 人物碰撞管理器(因为碰撞物体不同,所以每碰撞一次,创建一次方法类对象)
    /// </summary>
    /// <param name="register_State"></param>
    /// <param name="state_Machines"></param>
    /// <param name="nature"></param>
    /// <param name="sth"></param>
    /// <param name="item"></param>
    void ColliderManager(GameResource.HumanNature nature, Transform sth)
    {
        AColliderMethod method = null;

        switch (sth.gameObject.layer)
        {
        case MyTags.Wide_Wall_Collider_Layer:

            //墙体碰撞方法实例
            method = new Wall(nature, sth);

            break;

        case MyTags.Ice_Layer:
            method = new Ice(nature, sth);
            break;

        case MyTags.Spring_Layer:
            //弹簧碰撞方法实例
            method = new Spring(nature, sth);
            break;

        case MyTags.Obstacle_Layer:
        case MyTags.Missile_Layer:
        case MyTags.Sword_Layer:
            //致死机关碰撞方法实例
            method = new DeadFunction(nature, sth);
            break;

        case MyTags.Fruit_Layer:
            method = new Fruit(sth);
            break;

        case MyTags.Chest_Layer:
            method = new Chest(sth);
            break;

        case MyTags.Toturial_Layer:
            method = new Toturial(sth);
            break;
        }
        if (method != null)
        {
            method.OnExecute();
        }
    }
コード例 #2
0
ファイル: Toturial.cs プロジェクト: chenleigit/War-of-Castles
    void Start()
    {
        inst = this;
        int levelID = Data.inst.GetCurrentMapInfo().id;

        if (!toturialData.haveLession(levelID) || Data.inst.gameMode != GameMode.Campaign)
        {
            End();
            return;
        }

        lession = toturialData.GetLession(levelID);
        index   = -1;
        Next();
        GameManager.inst.Stop();
        GameManager3D.inst3D.panelStop.SetActive(false);
        btnStop.SetActive(false);
    }