Example #1
0
		override protected void _Calculate()
		{
			CellObjCtrl ctrlBwd = 
				CellObjCtrlUtils.GetNbCellObjCtrl (_cellCtrl, 3);
			if (_cellCtrl._TgtObj == null) {
				return;
			}

			bool bBackToBack = CellObjCtrlUtils.IsBackToBack (_cellCtrl);

			MiroModelV1 modelMe = 
				_cellCtrl._TgtObj.GetComponent<MiroModelV1> ();
			bool bHasFarm = modelMe.HasFarm ();
			bool bToGrow = (!bHasFarm && bBackToBack);
			bool bToShrink = (bHasFarm && !bBackToBack);
			if (bToGrow) {
				MiroModelV1 modelBwd = 
					ctrlBwd._TgtObj.GetComponent<MiroModelV1> ();
				_mgr.CreateEN2FarmFor2 (
					modelMe,_cellCtrl.transform, 
					modelBwd,ctrlBwd.transform);
				RecordNewFarm (_cellCtrl, ctrlBwd);
				//Debug.Log ("GrowFarm2 at " + _cellCtrl);
			} else if (bToShrink) {
				ShrinkFarm2 (_cellCtrl);
				//Debug.Log ("ShrinkFarm2 at " + _cellCtrl);
			}

		}