public GameObject TryMove(Vector3 newPosition)
    {
        //////////////////////////////////////
        //Local Variables

        RaycastHit hit;

        //////////////////////////////////////

        BoxCollider.enabled = false;
        Physics.Linecast(transform.position, newPosition, out hit);
        Debug.DrawLine(transform.position, newPosition, Color.red, 10.0f);
        BoxCollider.enabled = true;

        if ((hit.transform != null) && (TraceDebugMove == true))
        {
            StaticTrace.Log(string.Format("Object name:  {0}", hit.collider.gameObject.name));
            StaticTrace.Log(string.Format("Blocked:  {0}", hit.collider.gameObject.GetComponent <Tile>().Blocked.ToString()));
        }

        if ((hit.transform == null) || (hit.collider.gameObject.GetComponent <Tile>().Blocked == false))
        {
            EnableMove   = true;
            MovePosition = newPosition;
            return(null);
        }

        else
        {
            return(hit.collider.gameObject);
        }
    }
Exemple #2
0
    public void SetNameBox(string name)
    {
        if (DebugMessage == true)
        {
            StaticTrace.Log(string.Format("New NameBox:  {0}", name));
        }

        nameLabel.Content.text = name;

        ShowName = true;
    }
    public static void UpdateModel(MainAggregate updatedAggregate)
    {
        try
        {
            FindAndUpdateModel(updatedAggregate);
        }

        catch (Exception ex)
        {
            StaticTrace.ExceptionLog(ex.Message, ex.StackTrace);
        }
    }
    public static void UpdatePlayerAttributesInModel(FighterAttributes attributes)
    {
        try
        {
            UpdateFighterAttributes(attributes);
        }

        catch (Exception ex)
        {
            StaticTrace.ExceptionLog(ex.Message, ex.StackTrace);
        }
    }
Exemple #5
0
    void Update()
    {
        try
        {
            UpdateLabels();
        }

        catch (Exception ex)
        {
            StaticTrace.ExceptionLog(ex.Message, ex.StackTrace);
        }
    }
    void Start()
    {
        try
        {
            GetMainController();
        }

        catch (Exception ex)
        {
            StaticTrace.ExceptionLog(ex.Message, ex.StackTrace);
        }
    }
Exemple #7
0
    void OnGUI()
    {
        try
        {
            DrawLabels();
        }

        catch (Exception ex)
        {
            StaticTrace.ExceptionLog(ex.Message, ex.StackTrace);
        }
    }
Exemple #8
0
    public void Start(EquipmentSlotState slot, FighterAttributes fighter)
    {
        try
        {
            Unequip(slot, fighter);
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
        }
    }
Exemple #9
0
    public void Start(FighterAttributes fighter)
    {
        try
        {
            UpdateBonus(fighter);
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
        }
    }
Exemple #10
0
    public void Start(AbstractItemAI item, FighterAttributes fighter)
    {
        try
        {
            Equip(item, fighter);
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
        }
    }
Exemple #11
0
    public static void Start(int value)
    {
        try
        {
            AddValue(value);
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
        }
    }
Exemple #12
0
    public void PreserveItem()
    {
        try
        {
            TryPreserve();
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
        }
    }
    public static InputSettings GetInputSettingsFromModel()
    {
        try
        {
            return(GetInputSettings());
        }

        catch (Exception ex)
        {
            StaticTrace.ExceptionLog(ex.Message, ex.StackTrace);
            return(null);
        }
    }
    public static MainAggregate ReturnModel()
    {
        try
        {
            return(FindAndReturnModel());
        }

        catch (Exception ex)
        {
            StaticTrace.ExceptionLog(ex.Message, ex.StackTrace);
            return(null);
        }
    }
    public static List <AbstractItemAI> GetItemListFromModel()
    {
        try
        {
            return(GetItemList());
        }

        catch (Exception ex)
        {
            StaticTrace.ExceptionLog(ex.Message, ex.StackTrace);
            return(null);
        }
    }
    public static FighterAttributes GetPlayerAttributesFromModel()
    {
        try
        {
            return(GetFighterAttributes());
        }

        catch (Exception ex)
        {
            StaticTrace.ExceptionLog(ex.Message, ex.StackTrace);
            return(null);
        }
    }
Exemple #17
0
    public static string Start(FighterAttributes attributes)
    {
        try
        {
            return(GetExamineMessage(attributes));
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
            return("Error in generating message.");
        }
    }
    public static string Start(string name)
    {
        try
        {
            return(RemoveTag(name));
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
            return(name);
        }
    }
Exemple #19
0
    public static int Start()
    {
        try
        {
            return(GetBonusHP());
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
            return(0);
        }
    }
Exemple #20
0
    public static int Start(int maxSpawns)
    {
        try
        {
            return(GetSpawns(maxSpawns));
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
            return(maxSpawns);
        }
    }
    public static FighterAttributes Start()
    {
        try
        {
            return(CreateAttributes());
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
            return(new FighterAttributes());
        }
    }
    public static Rect Start(Rect rectGUI)
    {
        try
        {
            return(SetRect(rectGUI));
        }

        catch (Exception ex)
        {
            StaticTrace.Log(ex.Message);
            StaticTrace.Log(ex.StackTrace);
            return(rectGUI);
        }
    }
Exemple #23
0
    private void SaveAggregate()
    {
        /////////////////////////////////////////////////////
        //Local Variables

        BinaryFormatter formatter = new BinaryFormatter();

        FileStream file;

        string filePath = "";

        /////////////////////////////////////////////////////

        filePath = GetFilePath();

        file = File.Create(filePath);

        formatter.Serialize(file, this.Aggregate);

        StaticTrace.Log(String.Format("File saved at '{0}'.", filePath));

        file.Close();
    }