コード例 #1
0
ファイル: Nights2Shamash.cs プロジェクト: mmandel/8Nights2
    void Start()
    {
        if (Nights2SpotMgr.Instance != null)
            _closestSpot = Nights2SpotMgr.Instance.FindClosestSpotTo(transform.position);

        _animator = gameObject.GetComponent<Animator>();
        _playerIsClose = false;
        SetAnimatorBool(PlayerCloseBool, false);
        SetAnimatorBool(ShamashOnBool, false);
        SetAnimatorBool(FlameExtinguishedBool, false);

        if (TunnelPivot != null)
            _defaultTunnelRot = TunnelPivot.rotation;

        //subscribe to state changed events
        if (Nights2Mgr.Instance != null)
            Nights2Mgr.Instance.OnStateChanged += OnNights2StateChanged;
    }
コード例 #2
0
ファイル: Nights2Beacon.cs プロジェクト: mmandel/8Nights2
    void Start()
    {
        //print out color of each candle along with where in the progression it lives
        /*int progreshIdx = -1;
        for(int i = 0 ; i < Nights2Mgr.Instance.CandlePathOrderLength() ; i++)
        {
           if (Nights2Mgr.Instance.GetPath(i).LeadsToBeacon == this)
           {
              progreshIdx = i;
              break;
           }
        }
        Debug.Log("color " +  progreshIdx + ": ( " + CandleColor.r * 255.0f + ", " + CandleColor.g * 255.0f + ", " + CandleColor.b * 255.0f + " ) " + gameObject.name); */

        if (Nights2SpotMgr.Instance != null)
            _closestSpot = Nights2SpotMgr.Instance.FindClosestSpotTo(transform.position);

        _animator = gameObject.GetComponent<Animator>();

        EightNightsMgr.GroupID group = Nights2AudioMgr.Instance.GetGroupForBeacon(this);
        _narrationSound = Nights2AudioMgr.Instance.GetNarrationForGroup(group);
        if (_narrationSound != null)
        {
           _narrationMeter = _narrationSound.gameObject.GetComponent<FModLevelMeter>();
           _narrationFFT = _narrationSound.gameObject.GetComponent<FModPrecomputedFFT>();
        }
        _narrationDuration = Nights2AudioMgr.Instance.GetNarrationTimeForGroup(group);

        SetIsNext(false);
        SetLit(false);

        //set our color
        for (int i = 0; i < DriveColors.Length; i++)
        {
           Renderer r = DriveColors[i].Mesh;
           string propName = DriveColors[i].ColorPropName;
           if ((r != null) && (propName.Length > 0))
              r.material.SetColor(propName, CandleColor);
        }

        //subscribe to state changed events
        if (Nights2Mgr.Instance != null)
        {
           Nights2Mgr.Instance.OnTeleported += OnTeleported;
           Nights2Mgr.Instance.OnStateChanged += OnNights2StateChanged;
        }
    }
コード例 #3
0
ファイル: Nights2SpotMgr.cs プロジェクト: mmandel/8Nights2
    public void MakeSpotActive(Nights2Spot s)
    {
        if (s == _activeSpot)
         return;

          if (_activeSpot != null)
         _activeSpot.MakeActive(false);

          _activeSpot = s;
          if (_activeSpot != null)
         _activeSpot.MakeActive(true);
    }
コード例 #4
0
ファイル: Nights2SpotMgr.cs プロジェクト: mmandel/8Nights2
 public SpotEventArgs(Nights2Spot s)
 {
     Spot = s;
 }
コード例 #5
0
ファイル: Nights2SpotMgr.cs プロジェクト: mmandel/8Nights2
    void Start()
    {
        //spawn into each location
           _spawned = new GameObject[Spots.Length];
           for (int i = 0; i < _spawned.Length; i++)
          {
         GameObject spawnedObj = Instantiate(SpotPrefab) as GameObject;
         Debug.Assert(spawnedObj != null);

         Nights2Spot spot = Spots[i];
         Debug.Assert(spot != null);
         spot.SetSpawned(spawnedObj);
         spot.MakeActive(false);

         spawnedObj.transform.parent = spot.transform;
         spawnedObj.transform.localPosition = Vector3.zero;
         spawnedObj.transform.localRotation = Quaternion.identity;

         _spawned[i] = spawnedObj;
          }

          _activeSpot = null;
    }
コード例 #6
0
ファイル: Nights2SpotMgr.cs プロジェクト: mmandel/8Nights2
 public void TriggerSpotFX(LightAction l, float overrideTime = 1.0f, Nights2Spot actionSpot = null, float optionalHoldTime = 0.50f)
 {
     _overrideStartTime = Time.time;
       _overrideTime = overrideTime; //how long to override for
       _overrideHoldTime = optionalHoldTime;
       _overrideAction = l;
       _actionSpot = actionSpot;
 }
コード例 #7
0
ファイル: Nights2SpotMgr.cs プロジェクト: mmandel/8Nights2
 public void NotifyLanternArrived(Nights2Spot spot)
 {
     if (OnLanternArrived != null)
      OnLanternArrived(this, new SpotEventArgs(spot));
 }