Пример #1
0
        public void StartDecloakPlanning()
        {
            ShipStand = MonoBehaviour.Instantiate(Game.Position.prefabShipStand, Selection.ThisShip.GetPosition(), Selection.ThisShip.GetRotation(), Board.BoardManager.GetBoard());
            ShipStand.transform.Find("ShipStandTemplate").Find("ShipStandInsert").Find("ShipStandInsertImage").Find("default").GetComponent <Renderer>().material = Selection.ThisShip.Model.transform.Find("RotationHelper").Find("RotationHelper2").Find("ShipAllParts").Find("ShipStand").Find("ShipStandInsert").Find("ShipStandInsertImage").Find("default").GetComponent <Renderer>().material;
            obstaclesStayDetectorBase = ShipStand.GetComponentInChildren <ObstaclesStayDetectorForced>();

            MovementTemplates.CurrentTemplate          = MovementTemplates.GetMovement2Ruler();
            MovementTemplates.CurrentTemplate.position = Selection.ThisShip.TransformPoint(new Vector3(0.5f, 0, -0.25f));

            foreach (Transform decloakHelper in Selection.ThisShip.GetDecloakHelper())
            {
                AvailableDecloakDirections.Add(decloakHelper.name, decloakHelper.Find("Finisher").position);
            }

            Roster.SetRaycastTargets(false);
            inReposition = true;
        }
Пример #2
0
        public void StartDecloakPlanning()
        {
            GameObject prefab = (GameObject)Resources.Load(Selection.ThisShip.ShipBase.TemporaryPrefabPath, typeof(GameObject));

            ShipStand = MonoBehaviour.Instantiate(prefab, Selection.ThisShip.GetPosition(), Selection.ThisShip.GetRotation(), BoardTools.Board.GetBoard());
            ShipStand.transform.Find("ShipBase").Find("ShipStandInsert").Find("ShipStandInsertImage").Find("default").GetComponent <Renderer>().material = Selection.ThisShip.Model.transform.Find("RotationHelper").Find("RotationHelper2").Find("ShipAllParts").Find("ShipBase").Find("ShipStandInsert").Find("ShipStandInsertImage").Find("default").GetComponent <Renderer>().material;
            ShipStand.transform.Find("ShipBase").Find("ObstaclesStayDetector").gameObject.AddComponent <ObstaclesStayDetectorForced>();
            obstaclesStayDetectorBase = ShipStand.GetComponentInChildren <ObstaclesStayDetectorForced>();

            MovementTemplates.CurrentTemplate          = MovementTemplates.GetMovement2Ruler();
            MovementTemplates.CurrentTemplate.position = Selection.ThisShip.TransformPoint(new Vector3(0.5f, 0, -0.25f));

            foreach (Transform decloakHelper in Selection.ThisShip.GetDecloakHelper())
            {
                AvailableDecloakDirections.Add(decloakHelper.name, decloakHelper.Find("Finisher").position);
            }

            Roster.SetRaycastTargets(false);
            TurnOnDragging();
        }