Example #1
0
    void Update()
    {
        if (!spellActive)
        {
            return;
        }

        if (uLink.Network.isServer)
        {
            PlayerControllerRTS originatorControllerScript = originatorGameObj.GetComponent <PlayerControllerRTS>();
            originatorControllerScript.MoveOrChase();
        }


        Vector3 pos = originatorGameObj.transform.position;

        transform.position = pos;


        float distanceFromDestination = Vector3.Distance(floorPos, transform.position);

        if (distanceFromDestination < 0.3f)
        {
            uLink.Network.Destroy(gameObject);
        }
    }
Example #2
0
    public void OnDestroy()
    {
        originatorPlayerScript.agent.Stop();
        //SLOWER DOWN BY 400%
        originatorPlayerScript.speedAdd -= 400;
        PlayerControllerRTS originatorControllerScript = originatorGameObj.GetComponent <PlayerControllerRTS>();

        originatorControllerScript.playerStatus = PlayerControllerRTS.PlayerState.idle;
        originatorPlayerScript.abilityLocked    = false;
        originatorPlayerScript.charLocked       = false;
    }
Example #3
0
 //Called when script has recieved all network data
 protected override void OnStart()
 {
     if (photonView.isMine)
     {
         originatorPlayerScript              = originatorGameObj.GetComponent <PlayerStats>();
         originatorPlayerScript._adValueAdd += 50;
         //originatorPlayerScript.UpdateAdds();
         PlayerControllerRTS originatorControllerScript = originatorGameObj.GetComponent <PlayerControllerRTS>();
         originatorControllerScript.playerStatus = PlayerControllerRTS.PlayerState.idle;
         originatorPlayerScript.abilityLocked    = false;
     }
 }
Example #4
0
 //Called when script has recieved all network data
 protected override void OnStart()
 {
     if (uLink.Network.isServer)
     {
         originatorPlayerScript              = originatorGameObj.GetComponent <PlayerStats>();
         originatorPlayerScript._adValueAdd += 50;
         originatorPlayerScript.UpdateAdds();
         PlayerControllerRTS originatorControllerScript = originatorGameObj.GetComponent <PlayerControllerRTS>();
         originatorControllerScript.playerStatus = PlayerControllerRTS.PlayerState.idle;
         originatorPlayerScript.abilityLocked    = false;
     }
 }
Example #5
0
 void Start()
 {
     playerCScript     = GetComponent <PlayerControllerRTS>();
     playerStatsScript = GetComponent <PlayerStats>();
 }