Ejemplo n.º 1
0
        /// <summary>
        /// Only Color for now, as there is only 2 states
        /// </summary>
        public virtual void RandomizeState()
        {
            int currentIndex = ManagerCGridGame.I.DataCellsStates.CellStatesColor.FindIndex(x => x == StateColor);
            int randomIndex  = UnityEngine.Random.Range(0, ManagerCGridGame.I.DataCellsStates.CellStatesColor.Count);

            while (currentIndex == randomIndex)
            {
                randomIndex = UnityEngine.Random.Range(0, ManagerCGridGame.I.DataCellsStates.CellStatesColor.Count);
            }
            StateColor = ManagerCGridGame.I.DataCellsStates.CellStatesColor[randomIndex];
        }
        public void SelectCellColor(CellLogic logic)
        {
            if (!ListLogicColor.Contains(logic))
            {
                return;
            }

            SelectedCellLogicColor = logic;
            SelectedCellDataColor  = SelectedCellLogicColor.Data;
            SelectedCellStateColor = SelectedCellDataColor.StateColor;

            DrawData.StateColor = SelectedCellStateColor;

            VisualizeCellColor(logic);
        }
Ejemplo n.º 3
0
        //protected virtual void Start() {

        //}
        //protected virtual void Update() {

        //}
        public virtual void Construct(int row, int column)      //, float energyMax
        {
            Row    = row;
            Column = column;
            if (ManagerCGridGame.I.FixedDataCellsImage)
            {
            }
            else
            {
                if (ManagerCGridGame.I.DataCellsStates.CellStatesColor != null)
                {
                    //Debug.Log("Current CellStates: " + ManagerCGridGame.I.DataCellsStates.CellStates);
                    StateColor = ManagerCGridGame.I.DataCellsStates.CellStatesColor.FirstOrDefault();

                    CellStateFormT = ManagerCGridGame.I.DataCellsStates.CellStatesFormT.FirstOrDefault();
                }
            }
        }
Ejemplo n.º 4
0
 public virtual void SetState(CellStateColor cellStateColor)
 {
     StateColor = cellStateColor;
 }