// Start is called before the first frame update void Start() { instructionScript = GameObject.FindGameObjectWithTag("InstructionScript").GetComponent <InstructionScript>(); camera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <PlayerCameraFollowScript>(); fader = GameObject.FindGameObjectWithTag("Fader").GetComponent <FaderScript>(); snowBallScript = GameObject.FindGameObjectWithTag("Snowball").GetComponent <SnowBallScript>(); }
// Start is called before the first frame update void Start() { snowBallScript = snowBall.GetComponent <SnowBallScript>(); minMeshX = transform.parent.transform.position.x; minMeshZ = transform.parent.transform.position.z; mesh = new Mesh(); meshCollider = GetComponent <MeshCollider>(); GetComponent <MeshFilter>().mesh = mesh; CreateMesh(); CreateSnow(); }
public void Charge(Vector3 position) { if (snowBallInstanceScript == null) { float ballDistance = 0.5f; float ballHeight = 1.8f; snowBallInstance = Instantiate ( snowBallPrefab, position, transform.rotation) as GameObject; snowBallInstance.transform.SetParent (centerEyeAnchor.transform); snowBallInstanceScript = snowBallInstance.GetComponent<SnowBallScript> (); snowBallInstanceScript.owner = gameObject; // Association } snowBallInstanceScript.Charge (); state = CharacterState.IS_CHARGING; Debug.Log ("building snowball"); }
// Start is called before the first frame update void Start() { instructionScript = GameObject.FindGameObjectWithTag("InstructionScript").GetComponent <InstructionScript>(); fader = GameObject.FindGameObjectWithTag("Fader").GetComponent <FaderScript>(); snowBallScript = GameObject.FindGameObjectWithTag("Snowball").GetComponent <SnowBallScript>(); }
private void Start() { snowBallScript = GameObject.FindGameObjectWithTag("Snowball").GetComponent <SnowBallScript>(); fader = GameObject.FindGameObjectWithTag("Fader").GetComponent <FaderScript>(); }
public void Shoot(Vector3 direction) { if (snowBallInstanceScript != null) { snowBallInstanceScript.Shoot (direction); snowBallInstanceScript = null; } }
public void Shoot() { if (snowBallInstanceScript != null) { Vector3 temp = new Vector3 (transform.TransformPoint (Vector3.zero).x, transform.TransformPoint (Vector3.zero).y, transform.TransformPoint (Vector3.zero).z); ; snowBallInstanceScript.transform.SetParent (null); //snowBallInstanceScript.enabled = false; snowBallInstanceScript.transform.localRotation = Quaternion.identity; snowBallInstanceScript.Shoot (centerEyeAnchor.transform.forward); //snowBallInstanceScript.transform.localPosition = Vector3.zero; //snowBallInstanceScript.transform.position= temp; snowBallInstanceScript = null; } }