コード例 #1
0
    public override void InteractWithObject(CharacterInteractControl interactZone)
    {
        // If empty && player has valid object, take object
        if (mixObject1 == null && mixTimeRemaining <= 0 && interactZone.IsHoldingObject())
        {
            interactZone.GiveAttachedObj(this);
            return;
        }
        if (mixObject1 != null && mixObject2 == null && mixTimeRemaining <= 0 && interactZone.IsHoldingObject())
        {
            interactZone.GiveAttachedObj(this);
            return;
        }


        // If full and cooking completed, and player is empty, give result to player
        if (mixObject1 != null && mixTimeRemaining <= 0 && !interactZone.IsHoldingObject())
        {
            interactZone.AttachCarryableObject(QueryMixedObject());
            mixObject1 = null;
            mixObject2 = null;
            currentItem1.SetActive(false);
            PlaySoundFX(1);
            return;
        }
    }
コード例 #2
0
    public void OnTriggerExit2D(Collider2D collision)
    {
        CharacterInteractControl interactible = collision.GetComponent <CharacterInteractControl>();

        if (interactible != null)
        {
            DoGlowPulse(false);
        }
    }
コード例 #3
0
    public void OnTriggerEnter2D(Collider2D collision)
    {
        CharacterInteractControl interactible = collision.GetComponent <CharacterInteractControl>();

        if (interactible != null && !isAnimating)
        {
            DoGlowPulse(true);
        }
    }
コード例 #4
0
    public override void InteractWithObject(CharacterInteractControl obj)
    {
        if (cooldownCounter - Time.time > cooldownTime)
        {
            // TODO: Play rejected sound
            return;
        }

        obj.GiveAttachedObj(this);
    }
コード例 #5
0
    public override void InteractWithObject(CharacterInteractControl interactZone)
    {
        // If player is holding an object, return
        if (interactZone.IsHoldingObject())
        {
            FloatingTextController.Instance.CreateFloatingPopupText("your hands are full", transform.position, default(Color), FloatingFadeMethod.Alpha);
            return;
        }
        // If cooldown is not ready, return
        if (cooldownCounter - Time.time > cooldownTime)
        {
            return;
        }

        interactZone.AttachCarryableObject(objGivenName);
        PlaySoundFX();
        // Set my cooldown counter
        cooldownCounter = Time.time + cooldownTime;
    }
コード例 #6
0
    public override void InteractWithObject(CharacterInteractControl interactZone)
    {
        // If empty && player has valid object, take object and begin cooking it
        if (cookingObject == null && cookTimeRemaining <= 0 && interactZone.IsHoldingObject())
        {
            interactZone.GiveAttachedObj(this);
            //PlaySoundFX(0);
            return;
        }

        // If full and cooking completed, and player is empty, give result to player
        if (cookingObject != null && cookTimeRemaining <= 0 && !interactZone.IsHoldingObject())
        {
            interactZone.AttachCarryableObject(QueryCookedObject());
            cookingObject = null;
            currentItem.SetActive(false);
            PlaySoundFX(1);
            return;
        }
    }
コード例 #7
0
 public virtual void InteractWithObject(CharacterInteractControl interactZone = null)
 {
 }