Beispiel #1
0
    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        LaserCannonSP lcsp = animator.GetComponent <LaserCannonSP> ();

        if (lcsp)
        {
            lcsp.SetPlayerSprite();
            lcsp.SetPlayerColor();
        }

        Transform        hacker = animator.GetComponentInChildren <ControlStatus> ().Hacker;
        LaserCannonState state  = animator.GetComponent <LaserCannonState> ();

        state.aimLaserLine.gameObject.SetActive(false);
        state.playerAimPos = hacker.position;

        if (hacker)
        {
            PlayerControl pc = hacker.GetComponent <PlayerControl> ();
            if (pc)
            {
                pc.canControl = false;
            }
        }
    }
    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        Transform hacker = animator.GetComponentInChildren <ControlStatus> ().Hacker;

        if (hacker)
        {
            PlayerControl pc = hacker.GetComponent <PlayerControl> ();
            HealthSystem  hs = hacker.GetComponent <HealthSystem> ();
            if (pc && !hs.IsDead())
            {
                pc.canControl = true;
            }
        }
        ControlStatus cs = animator.GetComponentInChildren <ControlStatus> ();

        if (cs)
        {
            cs.controller = Controller.None;
        }

        LaserCannonSP lcsp = animator.GetComponent <LaserCannonSP> ();

        if (lcsp)
        {
            lcsp.SetNoneSprite();
        }


        animator.ResetTrigger("playerLink");
    }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        animator = GetComponent <Animator> ();
        fov      = GetComponentInChildren <FieldOfView> ();
        sp       = GetComponent <LaserCannonSP> ();
        //picker = GetComponentInChildren<ServerPicker> ();

        playerAimPos = shootLaser.position;
    }
Beispiel #4
0
    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        LaserCannonSP lcsp = animator.GetComponent <LaserCannonSP> ();

        if (lcsp)
        {
            lcsp.SetEnemySprite();
            lcsp.SetEnemyColor();
        }


        LaserCannonState state = animator.GetComponent <LaserCannonState> ();

        state.aimLaserLine.gameObject.SetActive(false);
        state.DisableShootLaser();
    }