Ejemplo n.º 1
0
 void Awake()
 {
     ToolTipText = GameObject.Find("Tooltip").GetComponent<TextMesh>();
     Interactor  = GameObject.Find("Interactor").GetComponent<cInteractor>();
     if (ToolTipText){
         MaxSize       = ToolTipText.characterSize;
         TipColor      = ToolTipText.renderer.material.color;
         TipColorBlend = new Color(TipColorBlend.r, TipColorBlend.g, TipColorBlend.b, 1.0f);
     }
 }
Ejemplo n.º 2
0
 void Awake()
 {
     ToolTipText = GameObject.Find("Tooltip").GetComponent <TextMesh>();
     Interactor  = GameObject.Find("Interactor").GetComponent <cInteractor>();
     if (ToolTipText)
     {
         MaxSize       = ToolTipText.characterSize;
         TipColor      = ToolTipText.renderer.material.color;
         TipColorBlend = new Color(TipColorBlend.r, TipColorBlend.g, TipColorBlend.b, 1.0f);
     }
 }
Ejemplo n.º 3
0
 void PickUnpick(GameObject ParentObject, cInteractor interactor)
 {
     if (!Parent){
         Parent = ParentObject;
         interactor.PickedObject = this;
         interactor.CurrentTarget = null;
     }
     else{
         Parent = null;
         interactor.PickedObject = null;
     }
 }
Ejemplo n.º 4
0
 void PickUnpick(GameObject ParentObject, cInteractor interactor)
 {
     if (!Parent)
     {
         Parent = ParentObject;
         interactor.PickedObject  = this;
         interactor.CurrentTarget = null;
     }
     else
     {
         Parent = null;
         interactor.PickedObject = null;
     }
 }
Ejemplo n.º 5
0
    void GetPlayerItem(cInteractor interactor)
    {
        // getting current player item
        if (Disabled)
        {
            return;
        }

        if (interactor)
        {
            if (interactor.PickedObject == null)
            {
                return;
            }

            if (PickableConditionsList.ContainsKey(interactor.PickedObject))
            {
                if (!DestroyConditionalObjects)
                {
                    PickableConditionsList[interactor.PickedObject] = true;
                }
                else
                {
                    PickableConditionsList.Remove(interactor.PickedObject);
                    Destroy(interactor.PickedObject.gameObject.transform.parent.gameObject);
                }
            }
        }

        bool OpenCondition = true;

        if (!DestroyConditionalObjects)
        {
            foreach (KeyValuePair <cPickable, bool> Condition in PickableConditionsList)
            {
                OpenCondition &= Condition.Value;
            }
        }
        else
        {
            OpenCondition = PickableConditionsList.Count == 0;
        }

        // Final condition
        if (OpenCondition)
        {
            cMessenger <GameObject> .Invoke("Push button", transform.parent.gameObject);
        }
    }
Ejemplo n.º 6
0
    void GetPlayerItem(cInteractor interactor)
    {
        // getting current player item
        if (Disabled){
            return;
        }

        if (interactor){

            if (interactor.PickedObject == null){
                return;
            }

            if (PickableConditionsList.ContainsKey(interactor.PickedObject)){

                if (!DestroyConditionalObjects){
                    PickableConditionsList[interactor.PickedObject] = true;
                }
                else
                {
                    PickableConditionsList.Remove(interactor.PickedObject);
                    Destroy(interactor.PickedObject.gameObject.transform.parent.gameObject);
                }

            }

        }

        bool OpenCondition = true;
        if (!DestroyConditionalObjects){
            foreach(KeyValuePair<cPickable, bool> Condition in PickableConditionsList)
            {
         			OpenCondition &= Condition.Value;
            }
        }else{
            OpenCondition = PickableConditionsList.Count == 0;
        }

        // Final condition
        if (OpenCondition){
            cMessenger<GameObject>.Invoke("Push button", transform.parent.gameObject);
        }
    }