Ejemplo n.º 1
0
    //public Vector3 myVector = Vector3.zero;

    // Start is called before the first frame update
    void Start()
    {
        PV          = GetComponent <PhotonView>();
        myCC        = GetComponent <CharacterController>();
        camera      = GetComponent <AvatarSetup>().myCamera;
        avatarSetup = GetComponent <AvatarSetup>();
    }
Ejemplo n.º 2
0
 private void OnEnable()
 {
     if (AvatarSetup.AS == null)
     {
         AvatarSetup.AS = this;
     }
 }
Ejemplo n.º 3
0
 private void Start()
 {
     pv                 = GetComponent <PhotonView>();
     avatarSetup        = GetComponent <AvatarSetup>();
     healthDisplay      = GameObject.Find("HealthText").GetComponent <Text>();
     healthDisplay.text = avatarSetup.playerHealth.ToString();
 }
Ejemplo n.º 4
0
    private void OnCollisionEnter(Collision collision)
    {
        if (collision.collider.tag != "Arrow")
        {
            Stick();
            this.transform.position = collision.contacts[0].point;
            GameObject anchor = new GameObject("Arrow_Anchor");
            anchor.transform.position = this.transform.position;
            anchor.transform.rotation = this.transform.rotation;
            anchor.transform.parent   = collision.transform;
            this.anchor = anchor.transform;

            hitSomething = true;
        }

        if (collision.collider.tag == "Avatar")
        {
            AvatarSetup pd = collision.gameObject.GetComponent <AvatarSetup>();
            pd.TakeDamage(ArrowDamage);

            Debug.Log("KnockBack");
            Rigidbody rb        = collision.collider.GetComponent <Rigidbody>();
            Vector3   direction = collision.transform.position - this.transform.position;
            direction.y = 0;

            rb.AddForce(direction.normalized * knockbackPower, ForceMode.Impulse);
        }
    }
Ejemplo n.º 5
0
 // Start is called before the first frame update
 void Start()
 {
     PV            = GetComponent <PhotonView>();
     avatarSetup   = GetComponent <AvatarSetup>();
     healthDisplay = GameSetup.GS.healthDisplay;
     manaDisplay   = GameSetup.GS.manaDisplay;
     mNavMeshAgent = GetComponent <NavMeshAgent>();
 }
Ejemplo n.º 6
0
 private bool IsLocalPlayer(Collider other, out AvatarSetup avatarSetup)
 {
     avatarSetup = other.GetComponentInParent <AvatarSetup>();
     if (avatarSetup == null)
     {
         return(false);
     }
     return(avatarSetup.photonView.IsMine);
 }
Ejemplo n.º 7
0
    private void Awake()
    {
        PV        = GetComponent <PhotonView>();
        RB        = GetComponent <Rigidbody2D>();
        AV        = GetComponent <AvatarSetup>();
        startTime = Time.time;
        anim      = GetComponentInChildren <Animator>();

        if (PV.IsMine)
        {
            GameSettings.GS.localPlayer = this;
        }
    }
Ejemplo n.º 8
0
 private void Start()
 {
     avatarSetups = FindObjectsOfType <AvatarSetup>();
     if (avatarSetups != null)
     {
         for (int i = 0; i < avatarSetups.Length; i++)
         {
             if (avatarSetups[i].GetComponent <PhotonView>().IsMine)
             {
                 avatar = avatarSetups[i];
             }
         }
     }
 }
Ejemplo n.º 9
0
 // Start is called before the first frame update
 void Start()
 {
     PV = GetComponent <PhotonView>();
     if (!PV.IsMine)
     {
         return;
     }
     if (PR == null)
     {
         PR = this;
     }
     avatar       = GetComponent <AvatarSetup>();
     avatarCombat = GetComponent <AvatarCombat>();
 }
Ejemplo n.º 10
0
 void Start()
 {
     PV = GetComponent <PhotonView>();
     if (!PV.IsMine)
     {
         return;
     }
     healthDisplay    = GameSetup.GS.playerHealth;
     healthBarDisplay = GameSetup.GS.playerHealthBar;
     avatarSetup      = GetComponent <AvatarSetup>();
     gunState         = GunStateMachine.NONE;
     reloading        = GameSetup.GS.reloading;
     bulletsLeft      = GameSetup.GS.bulletsLeft;
     bullets          = GameSetup.GS.bullets;
 }
Ejemplo n.º 11
0
 void Start()
 {
     PV          = GetComponent <PhotonView>();
     avatarSetup = GetComponent <AvatarSetup>();
     healthUI    = GameSetup.GS.healthUI;
 }
Ejemplo n.º 12
0
 private void Start()
 {
     pv  = GetComponent <PhotonView>();
     avs = GetComponent <AvatarSetup>();
 }
Ejemplo n.º 13
0
 // Start is called before the first frame update
 void Start()
 {
     PV          = GetComponent <PhotonView>();
     avatarSetup = GetComponent <AvatarSetup>();
 }
Ejemplo n.º 14
0
 void Start()
 {
     PV             = GetComponent <PhotonView>();
     Cursor.visible = false;
     avatarSetup    = GetComponent <AvatarSetup>();
 }
Ejemplo n.º 15
0
 // Start is called before the first frame update
 void Start()
 {
     arrowbody   = GetComponent <Rigidbody>();
     PV          = GetComponent <PhotonView>();
     avatarSetup = GetComponent <AvatarSetup>();
 }
Ejemplo n.º 16
0
 // Use this for initialization
 void Start()
 {
     PV          = GetComponent <PhotonView>();
     avatarSetup = GetComponent <AvatarSetup>();
     rayOrigin   = transform;
 }