Advertisement
piluve

Strike API

Jul 17th, 2018
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.06 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using simul;
  5.  
  6. public class CamStormMove : MonoBehaviour
  7. {
  8.     public Vector3 StrikeStart;
  9.     public Vector3 StrikeEnd;
  10.  
  11.     private void Update()
  12.     {
  13.         // Spawn a strike at the cloud base strike must be where there is cloud, otherwise
  14.         // the strike won't be rendered
  15.         var ts = trueSKY.GetTrueSky();
  16.         StrikeStart.y = ((float)ts.GetKeyframeValue(ts.GetInterpolatedCloudKeyframe(0), "cloudBase")) * 1000.0f;
  17.         StrikeStart.y += 400.0f;
  18.         if (Input.GetKeyDown(KeyCode.Tab))
  19.         {
  20.             ts.SpawnStrike(StrikeStart, StrikeEnd);
  21.         }
  22.     }
  23.  
  24.     private void OnDrawGizmos()
  25.     {
  26.         // Get current strike and draw a sphere at endpos
  27.         var ts = trueSKY.GetTrueSky();
  28.         var strike = ts.GetCurrentStrike();
  29.         if(strike.id != 0)
  30.         {
  31.             Gizmos.color = Color.red;
  32.             Gizmos.DrawSphere(new Vector3(strike.endpos.x, strike.endpos.y, strike.endpos.z), 500.0f);
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement