private void GoToAnchor(MachineStrategyAnchor a)
 {
     if (a != null && a.myMachine.IsAccessible)
     {
         SetNewMachine(a.myMachine, a.transform.position);
         CurrentAnchor = a;
         CurrentFocus = a.transform;
     }
 }
 private IEnumerator WaitUntilInvasion()
 {
     IsPlottingOrInvading = true;
     InvasionForce = GetRandomInvasionForce();
     yield return new WaitForSecondsInterruptTime(GetRandomInvasionTime());
     MachineInvasionTarget = FindRandomMachine();
     StartInvasion();
 }
    void Awake()
    {
        Instance = this;
        CyberspaceBattlefield.Current = new CyberspaceBattlefield();
        StrategyConsole.Initialize(consoleText);
        OxygenConsumer.Instance.IsConsumingSlowly = true;

        foreach(Machine m in CyberspaceBattlefield.Current.CurrentNetwork.Machines)
        {
            MachineStrategyAnchor foundA = GameObject.Find(m.Name).GetComponent<MachineStrategyAnchor>();
            Anchors.Add(foundA);
            foundA.myMachine = m;
            if (m.Name.ToLower() == "gatewaymachine")
            {
                CurrentMachine = m;
                CurrentAnchor = foundA;
                CurrentFocus = foundA.transform;
            }
        }
        RefreshAVButton();
    }
Ejemplo n.º 4
0
    internal Transform StartAntivirus(Transform aVBattleshipPrefab, MachineStrategyAnchor currentAnchor)
    {
        this.HasActiveAV = true;
        this.isTilted = false;

        Transform av = GameObject.Instantiate<Transform>(aVBattleshipPrefab);
        av.SetParent(currentAnchor.transform);
        av.localPosition = Vector3.forward * 140f;
        av.GetComponent<OrbitAround>().OrbitAnchor = currentAnchor.transform;
        this.Hardpoints = av.GetComponentsInChildren<Hardpoint>();

        return av;
    }