예제 #1
0
    protected new  void Start()
    {
        //Cache Components.
        animator    = GetComponent <Animator>();
        sprite      = GetComponent <SpriteRenderer>();
        audioSource = GetComponent <AudioSource>();
        ZDAudioSource.SetupAudioSource(audioSource);

        //Setup TeamID.
        if (photonView.Owner.CustomProperties.ContainsKey("Team"))
        {
            TeamID = (int)photonView.Owner.CustomProperties["Team"];
        }
        else
        {
            TeamID = -1;
        }
        //Register To GameManager.
        if (ZDGameManager.Instance)
        {
            ZDGameManager.Instance.CharacterList.Add(this);
        }

        //Setup Depth
        if (photonView.IsMine)
        {
            ActorType = EActorType.LocalCharacter;
        }
        else
        {
            ActorType = EActorType.RemoteCharacter;
        }

        base.Start();
    }
예제 #2
0
 protected new void Start()
 {
     ActorCustomDepthShift = (int)ZDGameRule.WorldToUnit(transform.position).x % 2 == 0 ?
                             -1e-5f :1e-5f;
     base.Start();
     animator    = GetComponent <Animator>();
     audioSource = GetComponent <AudioSource>();
     ZDAudioSource.SetupAudioSource(audioSource);
     //StartCoroutine(PauseAndPlay());
 }
 // Start is called before the first frame update
 void Start()
 {
     audioSource = GetComponent <AudioSource>();
     if (audioSource)
     {
         ZDAudioSource.SetupAudioSource(audioSource);
         audioSource.clip   = clip;
         audioSource.volume = vol;
         audioSource.loop   = loop;
         audioSource.Play();
         enabled = true;
     }
     else
     {
         Destroy(gameObject);
     }
 }