Beispiel #1
0
    public static Avatar GET_AVATAR(GameData.TYPE type)
    {
        Avatar avt = null;

        switch (type)
        {
        case GameData.TYPE.A:
            avt = ME.AVT_ROCKET;
            //actions = BANK_ACTION.AVT_ROCKET;
            break;

        case GameData.TYPE.B:
            avt = ME.AVT_KABOOM;
            //actions = BANK_ACTION.AVT_KABOOM;
            break;

        case GameData.TYPE.C:
            avt = ME.AVT_TRICKSTER;
            //actions = BANK_ACTION.AVT_TRICKSTER;
            break;

        case GameData.TYPE.MONK:
            avt = ME.AVT_MONK;
            break;

        case GameData.TYPE.E:
            avt = ME.AVT_SHIELD;
            break;

        case GameData.TYPE.F:
            avt = ME.AVT_MEDIC;
            break;
        }
        return(avt);
    }
Beispiel #2
0
 void hdrNewHero(GameData.TYPE type)
 {
     IS_NEW_INPUT  = true;
     HERO_SELECTED = type;
     m_UITeam.SetActive(false);
     m_UIHero.SetActive(false);
     Cursor.lockState = CursorLockMode.Locked;
 }
Beispiel #3
0
 public void RpcChangeHero(GameData.TYPE hero)
 {
     instantiateAvatar(m_entity.m_team, hero);
     if (m_entity == null)
     {
         return;
     }
     m_entity.m_type = hero;
     PhysicsLayer.SET_PLAYER(this.m_avatar, this.m_entity.m_team);
 }
Beispiel #4
0
    void instantiateAvatar(GameData.TEAM team, GameData.TYPE hero)
    {
        Debug.Log("INSTA " + team + " , " + hero);
        Avatar             avt     = null;
        EntityMotorActions actions = null;

        avt     = PrefabBank.GET_AVATAR(hero);
        actions = EntityMotorActionBank.GET(hero);
        if (avt == null)
        {
            return;
        }

        m_entityMotor.resetState();
        if (m_avatar != null)
        {
            GameObject.Destroy(m_avatar.gameObject);
        }
        if (m_entityMotorActions != null)
        {
            m_entityMotorActions.unLink(this.m_entityMotor);
            GameObject.Destroy(m_entityMotorActions.gameObject);
            m_entityMotorActions = null;
        }
        Avatar me = GameObject.Instantiate <Avatar>(avt);

        me.transform.parent        = this.transform;
        me.transform.localPosition = Vector3.zero;
        me.transform.localRotation = Quaternion.identity;
        //Debug.Log(team);
        if (team == GameData.TEAM.RED)
        {
            me.setMaterial(BANK_PREFAB.MAT_TEAM_RED);
        }
        else if (team == GameData.TEAM.BLUE)
        {
            me.setMaterial(BANK_PREFAB.MAT_TEAM_BLUE);
        }

        if (me.m_head == null)
        {
            m_netTransformChildHead.enabled = false;
        }
        else
        {
            m_netTransformChildHead.enabled = true;
            m_netTransformChildHead.target  = me.m_head.transform;
        }
        m_avatar = me;
        if (actions != null)
        {
            m_entityMotorActions = GameObject.Instantiate <EntityMotorActions>(actions);
            m_entityMotorActions.link(m_entityMotor);
        }
    }
    public static EntityMotorActions GET(GameData.TYPE hero)
    {
        EntityMotorActions actions = null;

        switch (hero)
        {
        case GameData.TYPE.A:
            actions = ME.AVT_ROCKET;
            break;

        case GameData.TYPE.B:
            actions = ME.AVT_KABOOM;
            break;

        case GameData.TYPE.C:
            actions = ME.AVT_TRICKSTER;
            break;

        case GameData.TYPE.MONK:
            actions = ME.MONK;
            break;
        }
        return(actions);
    }
Beispiel #6
0
 void h_heroMonk()
 {
     newInput       = true;
     m_heroSelected = GameData.TYPE.MONK;
 }
Beispiel #7
0
 void h_heroC()
 {
     newInput       = true;
     m_heroSelected = GameData.TYPE.C;
 }
Beispiel #8
0
 public void TargetInstantiateAvatar(NetworkConnection target, GameData.TEAM team, GameData.TYPE hero)
 {
     this.m_entity.m_team = team;
     this.m_entity.m_type = hero;
     instantiateAvatar(team, hero);
 }
Beispiel #9
0
 public void CmdChangeHero(GameData.TYPE hero)
 {
     RpcChangeHero(hero);
 }