Example #1
0
    // Use this for initialization
    void Start()
    {
        if (characterType == null)
        {
            characterType = GetComponent <MindControlType>();
        }

        ph = GameObject.Find("PlayHud").transform.GetComponent <HUDstate>();
        if (characterType.GetComponent <MindControlType>())
        {
            ph.Hypno();
        }
        else if (characterType.GetComponent <TeleportType>())
        {
            ph.Teleport();
        }
        else if (characterType.GetComponent <BrawlerType>())
        {
            ph.Hypno();
        }
        else if (characterType.GetComponent <GunnerType>())
        {
            ph.Hypno();
        }


        animator = GetComponent <Animator>();
        speed    = characterType.GetMoveSpeed() + GlobalMoveSpeed.GetSpeedDelta();
        prevPos  = transform.position;
        hp       = characterType.GetHP();
        if (name != null)
        {
            name.text = characterType.name;
        }
    }
Example #2
0
    void UpdateUI()
    {
        ph = GameObject.Find("PlayHud").transform.GetComponent <HUDstate>();

        if (GetComponent <MindControlType>())
        {
            ph.Hypno();
        }
        else if (GetComponent <TeleportType>())
        {
            ph.Teleport();
        }
        else if (GetComponent <BrawlerType>())
        {
            ph.Puncher();
        }
        else if (GetComponent <GunnerType>())
        {
            ph.Shooter();
        }


        ph.blinking = !GetComponent <CharacterType>().neutral;
        health.text = hp + "";
    }