Ejemplo n.º 1
0
 protected void ResetSwingDirection()
 {
     transform.localScale = new Vector3(initialKnightSize.x, transform.localScale.y, transform.localScale.z);
     if (host.GetType() == typeof(Player))
     {
         var player = ((Player)host);
         player.CancelSwing();
         player.mouseLook.freeze = false;
         Cursor.lockState        = CursorLockMode.Locked;
         Cursor.lockState        = CursorLockMode.None;
     }
     swordCollider.size = initialSize;
 }
Ejemplo n.º 2
0
    protected void SpawnCutText(Ingredient ing)
    {
        if (host.GetType() != typeof(Player))
        {
            return;
        }
        var inv   = (host.GetInventory() as InventoryBoard);
        var popup = Instantiate(inv.slashTextPrefab);

        popup.transform.SetParent(inv.canvasElement.transform.parent);
        popup.transform.SetSiblingIndex(popup.transform.parent.childCount - 2);
        popup.transform.localPosition = Vector3.zero;
        popup.name = "Slash Popup Text";
        popup.GetComponent <TrackObjectOnScreen>().Init(ing.gameObject);
        popup.transform.localScale = Vector3.one;

        var subText = popup.transform.GetChild(0).GetComponent <Text>();

        subText.text = "/" + ing.cutStage;
    }