public void AddInteraction()
        {
            GameObject interactionsRoot = GetComponentInChildren <Gaze_Interaction>().transform.parent.gameObject;

            GameObject interactionHide = new GameObject("HideOnDrop");

            interactionHide.transform.parent = interactionsRoot.transform;
            Gaze_Interaction i1 = interactionHide.AddComponent <Gaze_Interaction>();

            i1.AddActions();
            i1.AddConditions();
            Gaze_Conditions c1 = i1.GetComponent <Gaze_Conditions>();

            c1.reload          = true;
            c1.reloadModeIndex = (int)Gaze_ReloadMode.INFINITE;
            Gaze_Actions a1 = i1.GetComponent <Gaze_Actions>();

            a1.ActionVisuals = Gaze_Actions.ACTIVABLE_OPTION.DEACTIVATE;

            GameObject interactionShow = new GameObject("ShowOnRemove");

            interactionShow.transform.parent = interactionsRoot.transform;
            Gaze_Interaction i2 = interactionShow.AddComponent <Gaze_Interaction>();

            i2.AddActions();
            i2.AddConditions();
            Gaze_Conditions c2 = i2.GetComponent <Gaze_Conditions>();

            c2.reload          = true;
            c2.reloadModeIndex = (int)Gaze_ReloadMode.INFINITE;
            Gaze_Actions a2 = i2.GetComponent <Gaze_Actions>();

            a2.ActionVisuals = Gaze_Actions.ACTIVABLE_OPTION.ACTIVATE;
        }
示例#2
0
 private void Awake()
 {
     gazeInteraction = GetComponent <Gaze_Interaction>();
     if (gazeInteraction == null)
     {
         Debug.LogError("Spatial Stories SDK: Can't find a Gaze Interacton Script on the interaction: " + name);
     }
 }