Esempio n. 1
0
 public virtual void MouseAimed(Genevieve genevieve)
 {
     if (IsCloseEnough(genevieve))
         GetComponent<Renderer>().material = Main.staticOverMatCloseEnough;
     else
         GetComponent<Renderer>().material = Main.staticOverMat;
 }
Esempio n. 2
0
 // Main callback
 public void Init(Genevieve genevieve)
 {
     this.genevieve = genevieve;
     cameraPivotPoint = transform.GetChild(0);
     cameraAnchor = cameraPivotPoint.GetChild(0);
     childCam = cameraAnchor.GetChild(0);
 }
 public override void Held(Genevieve genevieve)
 {
     transform.position = genevieve.rightHand.position;
     transform.rotation = genevieve.rightHand.rotation;
     if (genevieve.gameManager.running && Input.GetMouseButton(1) && !genevieve.moving)
     {
         genevieve.animToPlay = 9;
         if ((new Vector2(transform.position.x, transform.position.z) - new Vector2(2.7f, 5.2f)).magnitude < 1.0f)
         {
             genevieve.gameManager.IncreaseCurrentLevelProgress(2);
         }
     }
     else
     {
         if (genevieve.moving)
             genevieve.animToPlay = 1;
         else
             genevieve.animToPlay = 0;
     }
 }
Esempio n. 4
0
 public override void Held(Genevieve genevieve)
 {
     transform.position = genevieve.leftHand.position;
     transform.rotation = Quaternion.LookRotation(genevieve.rightHand.position - genevieve.leftHand.position);
     if (genevieve.gameManager.running && Input.GetMouseButton(1) && !genevieve.moving)
     {
         genevieve.animToPlay = 3;
         if(timer.Get() >= hitDuration)
         {
             timer.Substract(hitDuration);
             genevieve.gameManager.IncreaseCurrentLevelProgress(0);
         }
     }
     else
     {
         if (genevieve.moving)
             genevieve.animToPlay = 5;
         else
             genevieve.animToPlay = 4;
         timer.Reset();
     }
 }
 public override void Held(Genevieve genevieve)
 {
     transform.position = genevieve.rightHand.position;
     transform.rotation = genevieve.rightHand.rotation;
     if (genevieve.gameManager.running && Input.GetMouseButton(1) && !genevieve.moving)
     {
         genevieve.animToPlay = 9;
         if (!gotEngrais && (new Vector2(transform.position.x, transform.position.z) -
             new Vector2(GameObject.Find("Map(Clone)").transform.Find("engrais").position.x, GameObject.Find("Map(Clone)").transform.Find("engrais").position.z)).magnitude < 1.0f)
         {
             gotEngrais = true;
             GameObject.Find("Map(Clone)").transform.Find("engrais").position = new Vector3(1000, 1000, 1000);
         }
         else if (!gotWhiteSpirit && (new Vector2(transform.position.x, transform.position.z) -
             new Vector2(GameObject.Find("Map(Clone)").transform.Find("white_spirit").position.x, GameObject.Find("Map(Clone)").transform.Find("white_spirit").position.z)).magnitude < 1.0f)
         {
             gotWhiteSpirit = true;
             GameObject.Find("Map(Clone)").transform.Find("white_spirit").position = new Vector3(1000, 1000, 1000);
         }
         else if (!gotPoireaux && (new Vector2(transform.position.x, transform.position.z) -
             new Vector2(GameObject.Find("Map(Clone)").transform.Find("poireau").position.x, GameObject.Find("Map(Clone)").transform.Find("poireau").position.z)).magnitude < 1.0f)
         {
             gotPoireaux = true;
             GameObject.Find("Map(Clone)").transform.Find("poireau").position = new Vector3(1000, 1000, 1000);
         }
         if(gotEngrais && gotWhiteSpirit && gotPoireaux)
         {
             genevieve.gameManager.IncreaseCurrentLevelProgress(5);
         }
     }
     else
     {
         if (genevieve.moving)
             genevieve.animToPlay = 1;
         else
             genevieve.animToPlay = 0;
     }
 }
Esempio n. 6
0
 public void ResetMap()
 {
     if (map != null)
     {
         Vector3 mapPos = map.transform.position;
         Quaternion mapRot = map.transform.rotation;
         GameObject.Destroy(map);
         map = GameObject.Instantiate(mapPrefab);
         map.transform.position = mapPos;
         map.transform.rotation = mapRot;
     }
     else
         map = GameObject.Instantiate(mapPrefab);
     genevieve = map.transform.Find("Genevieve").GetComponent<Genevieve>();
     salle = map.transform.Find("salle").GetComponent<AudioSource>();
     mamySource = map.transform.Find("mamySource").GetComponent<AudioSource>();
     porteLargeRigidBody = map.transform.Find("porte_large").GetComponent<Rigidbody>();
     dog = map.transform.Find("dog").GetComponent<Dog>();
     genevieve.Init(cameraController);
     genevieve.gameManager = gameManager;
     cameraController.Init(genevieve);
     cameraController.gameManager = gameManager;
 }
 public override void Held(Genevieve genevieve)
 {
 }
 public override void Take(Genevieve genevieve)
 {
     genevieve.gameManager.IncreaseCurrentLevelProgress(4);
 }
 public override void Take(Genevieve genevieve)
 {
     base.Take(genevieve);
 }
Esempio n. 10
0
 public virtual void Throw(Genevieve genevieve)
 {
     GetComponent<Rigidbody>().detectCollisions = true;
     GetComponent<Collider>().enabled = true;
     transform.position = genevieve.transform.position + new Vector3(genevieve.cameraController.GetDirection().x, 2, genevieve.cameraController.GetDirection().y);
 }
Esempio n. 11
0
 public virtual void Take(Genevieve genevieve)
 {
     GetComponent<Renderer>().material = originMat;
     GetComponent<Rigidbody>().detectCollisions = false;
     GetComponent<Collider>().enabled = false;
 }
Esempio n. 12
0
 public virtual void MouseLeave(Genevieve genevieve)
 {
     GetComponent<Renderer>().material = originMat;
 }
Esempio n. 13
0
 public virtual void MouseEnter(Genevieve genevieve)
 {
 }
Esempio n. 14
0
 public virtual bool IsCloseEnough(Genevieve genevieve)
 {
     return (new Vector2(genevieve.transform.position.x, genevieve.transform.position.z) - new Vector2(transform.position.x, transform.position.z)).magnitude < 2.5f;
 }
Esempio n. 15
0
 public virtual void Held(Genevieve genevieve)
 {
 }
Esempio n. 16
0
 public override void Take(Genevieve genevieve)
 {
     base.Take(genevieve);
     timer.Reset();
 }