コード例 #1
0
ファイル: ABManager.cs プロジェクト: daxingyou/client-2
 public void Init(string abName, Action <string, AssetBundle> abCacheHandler)
 {
     assetBundleName          = abName;
     assetBundleCacheHandler  = abCacheHandler;
     assetBundleCreateRequest = AssetBundle.LoadFromFileAsync(GameConst.DataPath + abName);
     timerInfo = TimerManager.AddHandler(OnUpdateHandler);
 }
コード例 #2
0
ファイル: NEffect.cs プロジェクト: daxingyou/client-2
 public void Play()
 {
     if (effect == null)
     {
         return;
     }
     effect.SetActive(true);
     if (!string.IsNullOrEmpty(soundName) && soundName != BindTypes.NONE)
     {
         AudioClip audioClip = ResourceManager.GetAudioClip(GameConst.SoundABDirectory + soundName, soundName);
         audioSource = effect.GetComponent <AudioSource>();
         if (audioSource == null)
         {
             audioSource = effect.AddComponent <AudioSource>();
         }
         audioSource.clip = audioClip;
         audioSource.loop = isLoop;
         audioSource.PlayDelayed(soundDelayTime);
     }
     if (!isLoop)
     {
         totalTime = 0f;
         duration  = SEffectManager.GetEffectDuration(effect, abName, prefabName);
         timerInfo = TimerManager.AddHandler(OnDelayHandler);
     }
 }
コード例 #3
0
 public void ReStart()
 {
     TimerManager.RemoveHandler(timerInfo);
     timerInfo = null;
     creature.FaceTo(Position);
     creature.PlayAnimation(AnimationType.Hit, true, null, OnEndHandler);
     speed     = MoveDistance / MoveTime;
     curTime   = 0f;
     timerInfo = TimerManager.AddHandler(OnTimeHandler);
 }
コード例 #4
0
 public override void OnEnter(FSMTranslation translatioin)
 {
     TimerManager.RemoveHandler(timerInfo);
     timerInfo           = null;
     characterController = creature.CharacterController;
     index = 0;
     creature.FaceTo(position);
     creature.PlayAnimation(actions[index]);
     speed     = FlyDistance / FlyTime;
     curTime   = 0f;
     timerInfo = TimerManager.AddHandler(OnTimeHandler);
 }
コード例 #5
0
    public void DoWalk()
    {
        if (path == null || player == null)
        {
            return;
        }
        if (characterController == null)
        {
            characterController = player.GetComponent <CharacterController>();
        }
        if (characterController == null)
        {
            return;
        }

        pathFinderNode = path[index];
        targetPos      = sceneInfo.GridToPixel(pathFinderNode.X, pathFinderNode.Y);
        player.transform.LookAt(targetPos);
        timerInfo = TimerManager.AddHandler(OnUpdateHandler);
    }