示例#1
0
    //// Start is called before the first frame update
    void Start()
    {
        relatedPlayer = Player.GetPlayerByIndex(relatedPlayerIndex);
        GameObject fighterIns = SpawFighter.GetFighterIns(relatedPlayer);

        if (fighterIns != null)
        {
            relatedAttrManager = fighterIns.GetComponent <FighterAttributesManager>();
        }

        Transform myTrans = transform;

        if (HPUpdateStrip != null && HPUpdateStrip.gameObject.activeSelf)
        {
            HPUpdateStrip.fighterIns          = fighterIns;
            relatedAttrManager.HPChangeEvent += HPUpdateStrip.OnChange;
        }
        if (MPUpdateStrip != null && MPUpdateStrip.gameObject.activeSelf)
        {
            MPUpdateStrip.fighterIns          = fighterIns;
            relatedAttrManager.MPChangeEvent += MPUpdateStrip.OnChange;
        }
        if (SPUpdateStrip != null && SPUpdateStrip.gameObject.activeSelf)
        {
            SPUpdateStrip.fighterIns          = fighterIns;
            relatedAttrManager.SPChangeEvent += SPUpdateStrip.OnChange;
        }
    }
示例#2
0
    //private void OnApplicationQuit()
    //{
    //    Debug.Log("Do OnApplicationQuit");
    //    int length = playerSelectedFightInfoPairs.Count;
    //    Player[] players = new Player[length];
    //    playerSelectedFightInfoPairs.Keys.CopyTo(players, 0);
    //    foreach (Player tempPlayer in players)
    //    {
    //        //PlayerInputInfo.SavePlayerInputConfig(tempPlayer);
    //        Player.SavePlayerInputConfig(tempPlayer);
    //    }
    //}

    public void SpawFighters()
    {
        int dicCount = playerSelectedFightInfoPairs.Count;

        Player[] keys = new Player[dicCount];
        playerSelectedFightInfoPairs.Keys.CopyTo(keys, 0);
        FighterSpawInfo[] values = new FighterSpawInfo[dicCount];
        playerSelectedFightInfoPairs.Values.CopyTo(values, 0);

        for (int i = 0; i < dicCount; i++)
        {
            Player          thisPlayer      = keys[i];
            FighterSpawInfo thisFighterInfo = values[i];
            Vector3         position        = Vector3.right * (-3 + 6 * i);
            GameObject      tempFighterGO   = Instantiate(fighterPrefab, position, Quaternion.identity);
            tempFighterGO.name = thisFighterInfo.fighterName;

            FightInput input = tempFighterGO.GetComponent <FightInput>();
            input.inputInfo = thisPlayer.playerInputInfo;

            SkillManager tempFighterSkillManager = tempFighterGO.GetComponent <SkillManager>();
            tempFighterSkillManager.testSkillTypes = thisFighterInfo.skillTypeNames;

            FighterAttributesManager tempFighterAttrManager = tempFighterGO.GetComponent <FighterAttributesManager>();
            tempFighterAttrManager.fighterAttr = thisFighterInfo.fighterAttr;

            playerFighterInsPairs.Add(thisPlayer, tempFighterGO);
        }
    }
示例#3
0
    public Status_Sprinting(GameObject rootGO, StatusManager statusManager, Animator anim) : base(rootGO, statusManager, anim)
    {
        rootTrans = rootGO.transform;
        coll      = this.rootGO.GetComponent <Collider2D>();

        layerSize = LayerMask.NameToLayer("Size");

        statusName     = "Sprinting";
        attrManager    = rootGO.GetComponent <FighterAttributesManager>();
        localTimeScale = rootGO.GetComponent <TimeScale>();
    }
示例#4
0
    public Skill(GameObject rootGO, SkillManager skillManager, Animator anim)
    {
        this.rootGO    = rootGO;
        mySkillManager = skillManager;
        this.anim      = anim;
        input          = mySkillManager.fightInput;
        attrManager    = this.rootGO.GetComponent <FighterAttributesManager>();

        info = LoadSpawSkillInfo();
        if (info != null)
        {
            orderKeyCodeIdxs = info.orderKeyCodeIdxs;
            influencePartGOs = FindGameObjects(info.influencedPartGameObjectNames);
        }
    }