예제 #1
0
 void OnDestroy()
 {
     if (Instance == this)
     {
         Instance = null;
     }
 }
예제 #2
0
 void Start()
 {
     if (Instance != null)
     {
         Destroy(this);
     }
     else
     {
         Instance = this;
     }
     TargetCharacter = ZDGameManager.GetPlayerProps().Script;
     ZDUIClass       = GameObject.Find("ZDUI").GetComponent <ZDUI>();
     BagClass        = GameObject.Find("Item").GetComponent <BagController>();
 }
예제 #3
0
 void FixedUpdate()
 {
     if (ZDGameManager.GetGameState() == ZDGameState.Play)
     {
         if (Shrink)
         {
             Vector3 FramScaleChange = ScaleChangeRate * Time.fixedDeltaTime;
             Vector3 DeltaScale      = TargetScale - VisibleArea.localScale;
             if (DeltaScale.magnitude < FramScaleChange.magnitude)
             {
                 Shrink = false;
                 VisibleArea.localScale = TargetScale;
             }
             else
             {
                 VisibleArea.localScale += FramScaleChange;
             }
         }
         if (DoDamage)
         {
             if (GetCachedInRestrict(ZDController.GetTargetCharacter()))
             {
                 cachedState.InZoneSeconds += Time.deltaTime;
                 if (cachedState.InZoneSeconds > ZDGameRule.RestrictZone.HurtThresh)
                 {
                     cachedState.InZoneSeconds = 0;
                     ZDController.GetTargetCharacter().Hurt(10);
                 }
             }
             else if (!cachedState.InZoneSeconds.Equals(0))
             {
                 cachedState.InZoneSeconds = 0;
             }
         }
     }
 }