コード例 #1
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.tag == "Star")
        {
            Destroy(collision.gameObject);
            SimulatedBool.simulated     = true;
            FollowBool.enabled          = false;
            ColliderPlayer.boolFlingOff = false;
        }
        if (collision.gameObject.tag == "Player")
        {
            FollowBool.enabled         = false;
            SimulatedBool.gravityScale = 3;
        }
        if (collision.gameObject.tag == "yunshi")
        {
            Debug.Log("dasdaddddd");

            StarMove aa = collision.gameObject.GetComponent <StarMove>();
            aa.enabled = false;
            if (!aa)
            {
                FollowBool.enabled = false;
            }
        }
    }
コード例 #2
0
    public void OnClickTypes(GameObject obj)
    {
        int index = int.Parse(obj.name);

        switch (index)
        {
        case 1:
            m_hechengUI.SetShow(true);
//                StarMove sm  =m_hechengUI.star_1.gameObject.GetComponent<StarMove>();
//                StarMove sm2 =m_hechengUI.star_2.gameObject.GetComponent<StarMove>();
//                sm.setBtnXing();
//                sm2.setBtnXing();
            HCStarMove();
            break;

        case 2:
            m_qianLiUI.SetShow(true);
            StarMove sm3 = m_qianLiUI.m_Star.gameObject.GetComponent <StarMove>();
            sm3.setBtnXing();
            break;

        case 3:
            m_attrSwapUI.SetShow(true);
            break;

        case 4:
            m_monEvolveUI.SetShow(true);
            break;
        }
        RED.SetActive(false, m_mainTraining);
    }
コード例 #3
0
    //合成界面 初始化星星
    private void HCStarMove()
    {
        StarMove sm  = m_hechengUI.star_1.gameObject.GetComponent <StarMove>();
        StarMove sm2 = m_hechengUI.star_2.gameObject.GetComponent <StarMove>();

        sm.setBtnXing();
        sm2.setBtnXing();
    }
コード例 #4
0
    public void ClearXX()
    {
        if (m_Star == null || m_Star.gameObject == null)
        {
            return;
        }

        StarMove sm = m_Star.gameObject.GetComponent <StarMove>();

        sm.ClearS();
    }
コード例 #5
0
    //初始化星星
    public void initXX()
    {
        if (m_Star == null || m_Star.gameObject == null)
        {
            return;
        }

        StarMove sm = m_Star.gameObject.GetComponent <StarMove>();

        sm.setBtnXing();
    }
コード例 #6
0
    //删除星星
    public void ClearStar()
    {
        if (m_Star == null || m_Star.gameObject == null)
        {
            return;
        }
        m_Star.gameObject.SetActive(false);
        StarMove sm = m_Star.gameObject.GetComponent <StarMove>();

        sm.ClearS();
    }
コード例 #7
0
    //初始化星星
    public void initStar()
    {
        if (m_Star == null || m_Star.gameObject == null)
        {
            return;
        }
        m_Star.gameObject.SetActive(true);
        StarMove sm = m_Star.gameObject.GetComponent <StarMove>();

        sm.ClearS();
        sm.setBtnXing();
    }
コード例 #8
0
    void InitUI(ENUM_TRAIN_TYPE type, Monster mon)
    {
        RED.SetActive(false, m_despUI.gameObject);
        if (type == ENUM_TRAIN_TYPE.None)
        {
            m_hechengUI.SetShow(false);
            m_attrSwapUI.SetShow(false);
            m_qianLiUI.SetShow(false);
            m_monEvolveUI.SetShow(false);
            RED.SetActive(true, m_mainTraining);
        }
        else if (type == ENUM_TRAIN_TYPE.HeCheng)
        {
            m_hechengUI.SetShow(true);
            m_attrSwapUI.SetShow(false);
            m_qianLiUI.SetShow(false);
            m_monEvolveUI.SetShow(false);
            RED.SetActive(false, m_mainTraining);
            _mInstanece.HCStarMove();
        }
        else if (type == ENUM_TRAIN_TYPE.AttrSwap)
        {
            m_hechengUI.SetShow(false);
            m_attrSwapUI.SetShow(true);
            m_qianLiUI.SetShow(false);
            m_monEvolveUI.SetShow(false);
            RED.SetActive(false, m_mainTraining);
        }
        else if (type == ENUM_TRAIN_TYPE.QianLiXunLian)
        {
            m_hechengUI.SetShow(false);
            m_attrSwapUI.SetShow(false);
            m_qianLiUI.SetShow(true);
            m_monEvolveUI.SetShow(false);
            RED.SetActive(false, m_mainTraining);

            StarMove sm3 = m_qianLiUI.m_Star.gameObject.GetComponent <StarMove>();
            sm3.setBtnXing();
        }
        else if (type == ENUM_TRAIN_TYPE.MonsterEvolve)
        {
            m_hechengUI.SetShow(false);
            m_attrSwapUI.SetShow(false);
            m_qianLiUI.SetShow(false);
            m_monEvolveUI.SetShow(true);

            RED.SetActive(false, m_mainTraining);
        }
    }
コード例 #9
0
    void OnClickBack()
    {
        StarMove sm3 = m_Star.gameObject.GetComponent <StarMove>();

        sm3.ClearS();
        m_data = null;
        InitUI();
        SetShow(false);
        RED.SetActive(true, TrainingRoomUI.mInstance.m_mainTraining);

        if (TrainingRoomUI.mInstance.m_callBack != null)
        {
            TrainingRoomUI.mInstance.OnClickExit();
        }
    }
コード例 #10
0
ファイル: diqiu1.cs プロジェクト: kosyunrin/skMYGAMES
 private void OnTriggerStay2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "yunshi")
     {
         Debug.Log("sdada");
         Rigidbody2D yunshi = collision.gameObject.GetComponent <Rigidbody2D>();
         yunshi.gravityScale = 0;
         StarMove yunshi1 = collision.gameObject.GetComponent <StarMove>();
         yunshi1.centerObj = gameObject;
         yunshi1.enabled   = true;
         CircleCollider2D yunshi2 = collision.gameObject.GetComponent <CircleCollider2D>();
     }
     if (collision.gameObject.tag == "Player")
     {
         GetComponent <CircleCollider2D>().radius = 1;
     }
 }
コード例 #11
0
    //清除星星
    public void ClearXX()
    {
        if (star_1 == null || star_1.gameObject == null)
        {
            return;
        }

        StarMove sm = star_1.gameObject.GetComponent <StarMove>();

        sm.ClearS();

        if (star_2 == null || star_2.gameObject == null)
        {
            return;
        }


        StarMove sm1 = star_2.gameObject.GetComponent <StarMove>();

        sm1.ClearS();
    }
コード例 #12
0
    //初始化星星
    public void initXX()
    {
        if (star_1 == null || star_1.gameObject == null)
        {
            return;
        }

        StarMove sm = star_1.gameObject.GetComponent <StarMove>();

        sm.setBtnXing();

        if (star_2 == null || star_2.gameObject == null)
        {
            return;
        }


        StarMove sm1 = star_2.gameObject.GetComponent <StarMove>();

        sm1.setBtnXing();
    }
コード例 #13
0
ファイル: MainGame.cs プロジェクト: s410385015/IMU_MAGIC
    public IEnumerator Generator()
    {
        gb.GenerateNote();
        Vector3    pos     = new Vector3(0, -0.5f, 0);
        int        handID  = gb.noteID;
        int        modeDir = gb.noteAngle;
        GameObject note;

        switch (handID)
        {
        case 1:
            note = Instantiate(s1, pos, transform.rotation);

            break;

        case 2:
            note = Instantiate(s2, pos, transform.rotation);

            break;

        case 3:
            note = Instantiate(s3, pos, transform.rotation);

            break;

        case 4:
            note = Instantiate(s4, pos, transform.rotation);
            break;

        default:
            note = Instantiate(s0, pos, transform.rotation);
            break;
        }
        note.AddComponent(typeof(StarMove));
        StarMove spt = (StarMove)note.GetComponent(typeof(StarMove));

        spt.ChangeMode(modeDir, handID, exp[handID - 1]);
        yield return(null);
    }