Example #1
0
 private IEnumerator SpitToPoint(FlaskContents flaskContents)
 {
     flaskContents.GetComponent <CarryEnabler>().canPickUp = false;
     while (!Mathf.Approximately(Vector3.Distance(flaskContents.transform.position, newSpot.transform.position), 0.0f))
     {
         flaskContents.transform.position = Vector3.MoveTowards(flaskContents.transform.position, newSpot.transform.position, spitSpeed * Time.deltaTime);
         yield return(null);
     }
     flaskContents.transform.parent = null;
     flaskContents.GetComponent <CarryEnabler>().canPickUp = true;
 }
Example #2
0
    private void CreateFromRecipe(Potion r)
    {
        FlaskContents newFlask = Instantiate(newPotionPrefab.gameObject).GetComponent <FlaskContents>();

        newFlask.contents           = r;
        newFlask.transform.parent   = transform;
        newFlask.transform.position = transform.position;

        StartCoroutine(SpitToPoint(newFlask));
        ShowMessage("WOO-HOO! We've made " + r.FString() + "!", 4.0f, delegate() {
            textField.text = "What shall we brew next?";
        });

        OnPotionMade.Invoke();
    }
Example #3
0
 public void TakePotion(FlaskContents c)
 {
     contents.Add(c.contents);
     CheckContents();
 }