Example #1
0
    public override bool UnRegisterObject(GameObject toUnRegister, IInteractionLogic id)
    {
        IUIData script = GetDesiredUIScript(toUnRegister, UIViewType.Objective);

        if (script != null && script.UIType == UIViewType.Objective)
        {
            script.EnableComponent(false);
            script.SetUIMessage(string.Empty);
        }
        return(true);
    }
Example #2
0
    public override bool RegisterObject(GameObject toRegister, IInteractionLogic id)
    {
        IUIData script = GetDesiredUIScript(toRegister, UIViewType.Objective);

        if (script != null)
        {
            script.EnableComponent(true);
            script.SetUIMessage(this.ObjectiveMessage);
        }
        return(true);
    }
Example #3
0
    public override bool UnRegisterObject(GameObject toUnRegister, IInteractionLogic id)
    {
        IUIData script = GetDesiredUIScript(toUnRegister, UIViewType.Dialog);

        if (script != null && script.UIType == UIViewType.Dialog)
        {
            IDialogData data = (IDialogData)script;
            data.EnableComponent(false);
            data.SetTitle(string.Empty);
            data.SetFormattedString(string.Empty);
        }
        return(base.UnRegisterObject(toUnRegister, id));
    }
Example #4
0
 public virtual bool RegisterObject(GameObject toRegister, IInteractionLogic id)
 {
     if (!storedObjects.ContainsValue(toRegister))
     {
         id.InputChangedWithId += Id_InputChangedWithId;
         storedObjects.Add(id.InteractionID, toRegister);
         if (OnRegister != null)
         {
             OnRegister(id);
         }
         return(true);
     }
     return(false);
 }
Example #5
0
    public override bool RegisterObject(GameObject toRegister, IInteractionLogic id)
    {
        bool wasSuccessFullRegister = base.RegisterObject(toRegister, id);

        if (wasSuccessFullRegister)
        {
            IUIData script = GetDesiredUIScript(toRegister, UIViewType.Supply);
            if (script != null)
            {
                script.EnableComponent(true);
                script.SetUIMessage(this.UIMessage);
            }
        }
        return(wasSuccessFullRegister);
    }
Example #6
0
    public override bool RegisterObject(GameObject toRegister, IInteractionLogic id)
    {
        bool wasSuccessFullRegister = base.RegisterObject(toRegister, id);

        if (wasSuccessFullRegister)
        {
            IUIData script = GetDesiredUIScript(toRegister, UIViewType.Dialog);
            if (script != null && script is IDialogData)
            {
                IDialogData data = (IDialogData)script;
                data.EnableComponent(true);
                data.SetTitle(this.Title);
                data.SetFormattedString(this.GetFormattedBulletPoints());
            }
        }
        return(wasSuccessFullRegister);
    }
Example #7
0
    public virtual bool UnRegisterObject(GameObject toUnRegister, IInteractionLogic id)
    {
        GameObject value;

        if (storedObjects.ContainsValue(toUnRegister) &&
            storedObjects.TryGetValue(id.InteractionID, out value) &&
            value == toUnRegister)
        {
            id.InputChangedWithId -= Id_InputChangedWithId;
            storedObjects.Remove(id.InteractionID);
            if (OnUnRegister != null)
            {
                OnUnRegister(id);
            }
            return(true);
        }
        return(false);
    }
 public InteractionController(IInteractionLogic interactionLogic)
 {
     _interactionLogic = interactionLogic;
 }
Example #9
0
 // Use this for initialization
 void Start()
 {
     interactebleInput = new InteractableInput();
     interactionLogic  = new InteractionLogic(ref interactebleInput, this.gameObject.GetInstanceID());
 }