Exemple #1
0
 void Start()
 {
     param      = GameObject.Find("cannon").GetComponent <initialCannon>();
     clone      = GameObject.Find("cannonBarrel").GetComponent <rotateObj>();
     last_shoot = 0.0F;
     cannonBall = param.cannonBall;
 }
Exemple #2
0
 void Start()
 {
     cannon      = GameObject.Find("cannonBase");
     param       = GameObject.Find("cannon").GetComponent <initialCannon>();
     myaudio     = GetComponent <AudioSource> ();
     fix_point   = cannon.transform.position;
     fix_point.y = transform.position.y;
     //LineRenderer lineRenderer = gameObject.AddComponent<LineRenderer>();
     //lineRenderer.material = new Material(Shader.Find("Unlit/Texture"));
     //lineRenderer.SetColors(c1, c1);
     //lineRenderer.SetWidth(0.1F, 0.1F);
     canCenter.Set(fix_point.x, 0.0F, fix_point.z);
     dp            = param.distanceThreshold;
     cone_view     = param.coneView;
     rotationSpeed = param.rotationSpeed;
     player        = param.target;
 }