// 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>();
 }
示例#2
0
    // 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();
    }
示例#3
0
    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");
    }
示例#4
0
 // 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>();
 }
示例#5
0
 private void Start()
 {
     snowBallScript = GameObject.FindGameObjectWithTag("Snowball").GetComponent <SnowBallScript>();
     fader          = GameObject.FindGameObjectWithTag("Fader").GetComponent <FaderScript>();
 }
示例#6
0
 public void Shoot(Vector3 direction)
 {
     if (snowBallInstanceScript != null) {
         snowBallInstanceScript.Shoot (direction);
         snowBallInstanceScript = null;
     }
 }
示例#7
0
 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;
     }
 }