Inheritance: MonoBehaviour
コード例 #1
0
    IEnumerator GivenPotion(SellPotion potion)
    {
        potion.transform.parent = transform;
        myAnimator.SetTrigger("leave");
        yield return(new WaitForSeconds(0.25f));

        myAgent.destination = travelToPosition.position;
        yield return(new WaitForSeconds(1));

        while (myAgent.remainingDistance > 0.5f)
        {
            yield return(null);
        }
        potion.gameObject.SetActive(false);
        myAgent.destination = standingPosition.position;
        yield return(new WaitForSeconds(1));

        while (myAgent.remainingDistance > 0.25f)
        {
            yield return(null);
        }
        myAnimator.SetTrigger("place");
        yield return(new WaitForSeconds(0.5f));

        RespawnManager respawner = FindObjectOfType <RespawnManager> ();

        foreach (GameObject rewardPrefab in potion.lootToReturn)
        {
            GameObject spawned = (GameObject)Instantiate(rewardPrefab, travelToPosition.position + Vector3.up, Quaternion.identity);
            respawner.Respawn(spawned);
        }
        Destroy(potion.gameObject);
    }
コード例 #2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
コード例 #3
0
 void Awake()
 {
     if (gc == null)
     {
         gc = this;
     }
     else
     {
         // if this one's a duplicate, destroy
         Destroy(this.gameObject);
         return;
     }
     DontDestroyOnLoad(this);
     titleText         = editorTitleText;
     dialogueUI        = GetComponentInChildren <DialogueUI>();
     signUI            = GetComponentInChildren <SignUI>();
     pc                = GetComponentInChildren <PlayerController>();
     rm                = GetComponent <RespawnManager>();
     playerFollower    = gc.GetComponentInChildren <PlayerFollower>();
     save              = gc.GetComponent <Save>();
     blackoutUI        = GetComponentInChildren <BlackFadeUI>();
     pauseUI           = gc.transform.Find("PixelCanvas").transform.Find("PauseUI").GetComponent <Animator>();
     abilityUIAnimator = gc.transform.Find("PixelCanvas").transform.Find("AbilityGetUI").GetComponent <Animator>();
     inventory         = gc.GetComponentInChildren <InventoryController>();
     parallaxOption    = gc.GetComponentInChildren <ParallaxOption>();
 }
コード例 #4
0
        public CharacterCampaignData(Client client, bool giveRespawnPenaltyAffliction = false)
        {
            Name = client.Name;
            InitProjSpecific(client);

            healthData = new XElement("health");
            client.Character?.CharacterHealth?.Save(healthData);
            if (giveRespawnPenaltyAffliction)
            {
                var respawnPenaltyAffliction = RespawnManager.GetRespawnPenaltyAffliction();
                healthData.Add(new XElement("Affliction",
                                            new XAttribute("identifier", respawnPenaltyAffliction.Identifier),
                                            new XAttribute("strength", respawnPenaltyAffliction.Strength.ToString("G", CultureInfo.InvariantCulture))));
            }
            if (client.Character?.Inventory != null)
            {
                itemData = new XElement("inventory");
                Character.SaveInventory(client.Character.Inventory, itemData);
            }
            OrderData = new XElement("orders");
            if (client.Character != null)
            {
                CharacterInfo.SaveOrderData(client.Character.Info, OrderData);
            }
        }
コード例 #5
0
ファイル: Goal.cs プロジェクト: moocow17/Valhalla-Ball
    // Start is called before the first frame update
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        scoreManager   = gameControllerObject.GetComponent <ScoreManager>();
        respawnManager = gameControllerObject.GetComponent <RespawnManager>();
    }
コード例 #6
0
 void Awake()
 {
     if (gc == null)
     {
         gc = this;
     }
     else
     {
         // if this one's a duplicate, destroy
         Destroy(this.gameObject);
         return;
     }
     DontDestroyOnLoad(this);
     titleText         = editorTitleText;
     dialogueUI        = GetComponentInChildren <DialogueUI>();
     signUI            = GetComponentInChildren <SignUI>();
     pc                = GetComponentInChildren <PlayerController>();
     rm                = GetComponent <RespawnManager>();
     playerFollower    = gc.GetComponentInChildren <PlayerFollower>();
     save              = gc.GetComponent <SaveWrapper>().save;
     blackoutUI        = GetComponentInChildren <BlackFadeUI>();
     pauseUI           = GetComponentInChildren <PauseUI>();
     abilityUIAnimator = GameObject.Find("AbilityGetUI").GetComponent <Animator>();
     inventory         = gc.GetComponentInChildren <InventoryController>();
     parallaxOption    = gc.GetComponentInChildren <ParallaxOption>();
     bossHealthUI      = GameObject.Find("BossHealthUI").GetComponent <BarUI>();
     bossHealthUI.gameObject.SetActive(false);
     playerMenu     = GameObject.Find("PlayerMenu");
     binarySaver    = gc.GetComponent <BinarySaver>();
     saveWrapper    = gc.GetComponent <SaveWrapper>();
     audioListener  = gc.GetComponentInChildren <AudioListener>();
     bossFightIntro = gc.GetComponentInChildren <BossFightIntro>(includeInactive: true);
 }
コード例 #7
0
    void Start()
    {
        cc                = GetComponent <PlayerController2D>();
        rb                = GetComponent <Rigidbody2D>();
        sr                = GetComponent <SpriteRenderer>();
        moveset           = GetComponent <MoveSet>();
        input             = GetComponent <InputHandler>();
        anim              = GetComponent <Animator>();
        health            = GetComponent <Health>();
        audioSource       = GetComponent <AudioSource>();
        ailmentHandler    = GetComponent <AilmentHandler>();
        knockbackListener = GetComponent <KnockbackListener>();
        cameraFocusPointDefaultPosition = cameraFocusPoint.transform.position;
        playerOffset = transform.position;
        spellList    = FindObjectOfType <SpellDatabase>();
        fas          = GetComponent <FighterAnimationScript>();

        input.player        = this;
        input.spellDatabase = spellList;
        fas.fighter         = this;
        fas.cc   = cc;
        fas.anim = anim;

        gm = FindObjectOfType <GameManager>();
        rm = FindObjectOfType <RespawnManager>();

        maxNumberOfJumps++;
        cc.m_maxJumps = maxNumberOfJumps;



        cc.m_doubleJumpEnabled = canDoubleJump;

        comboTimer = defaultComboTime;
    }
コード例 #8
0
        public static void Postfix(RespawnManager __instance, SpawnableTeamType teamToSpawn)
        {
            int counter = 0;

            foreach (Player Ply in Player.List)
            {
                if (Ply.Role.IsNotHuman(true))
                {
                    counter++;
                }
            }
            if (CreativeToolbox.ConfigRef.Config.EnableRandomChaosInsurgencyAnnouncementChance)
            {
                NewChance = CIAnnouncementChance.Next(0, 100);
                if (NewChance < CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncementChance)
                {
                    if (CreativeToolbox.ConfigRef.Config.EnableCustomAnnouncements && teamToSpawn == SpawnableTeamType.ChaosInsurgency)
                    {
                        NineTailedFoxAnnouncer.singleton.ServerOnlyAddGlitchyPhrase(CreativeToolboxEventHandler.FormatMessage(CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncement, counter), CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncementGlitchChance * 0.01f, CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncementJamChance * 0.01f);
                    }
                }
            }
            else
            if (CreativeToolbox.ConfigRef.Config.EnableCustomAnnouncements && teamToSpawn == SpawnableTeamType.ChaosInsurgency)
            {
                NineTailedFoxAnnouncer.singleton.ServerOnlyAddGlitchyPhrase(CreativeToolboxEventHandler.FormatMessage(CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncement, counter), CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncementGlitchChance * 0.01f, CreativeToolbox.ConfigRef.Config.ChaosInsurgencyAnnouncementJamChance * 0.01f);
            }
        }
コード例 #9
0
 // Use this for initialization
 void Start()
 {
     m_RespawnManager = GameObject.FindGameObjectWithTag("RespawnManager").GetComponent <RespawnManager> ();
     if (m_RespawnManager == null)
     {
         m_LobbySpawn = GameObject.FindGameObjectWithTag("RespawnManager").GetComponent <LobbySpawn> ();
     }
 }
コード例 #10
0
    void Start()
    {
        //transform.position = startCenter.transform.position;

        rigid          = character.GetComponent <Rigidbody>();
        anim           = character.GetComponent <Animator>();
        respawnManager = FindObjectOfType <RespawnManager>();
    }
コード例 #11
0
 // Start is called before the first frame update
 void Start()
 {
     gamePlaying           = false;
     gameIsOver            = false;
     playAgainDisplay.text = "";
     respawnManager        = GetComponent <RespawnManager>();
     StartCoroutine(CountdownToStart());
 }
コード例 #12
0
 private void OnDisable()
 {
     if (!MainLevel.Instance)
     {
         return;
     }
     RespawnManager.Get().UnregisterRespawnPoint(this);
 }
コード例 #13
0
    /// <summary>
    /// This deserializses and loads the latest save making it possible to jump back to a previous spawnpoint or continue an already started game
    /// when pressing the load button. This needs testing
    /// </summary>
    public void LoadSave()
    {
        spawner = GameManager.managerWasa.RespawnManage; // current solution will be replaced when respawnsystem is rewamped to higher level in hierarchy
        RepawnInsans inst = SaveAndLoad.LoadGameData();  // create respawninstance that is used for loading the game

        spawner.RespwnNow(inst);                         // calls the respawn now function of the respawnmanager
        Resume();                                        // resumes game to where it was for a little while ago.
    }
コード例 #14
0
    private void Awake()
    {
        rigidbody2D = GetComponent <Rigidbody2D>();
        gameObject  = rigidbody2D.gameObject;
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");

        gameController = gameControllerObject.GetComponent <RespawnManager>();
    }
コード例 #15
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         RespawnManager manager = GameObject.FindObjectOfType <RespawnManager>();
         manager.SetPlayerPosition(other.transform);
     }
 }
コード例 #16
0
 private void Awake()
 {
     if (Singleton)
     {
         enabled = false;
         return;
     }
     Singleton = this;
 }
コード例 #17
0
    private void Start()
    {
        if (instance != null)
        {
            Debug.LogWarning("RespawnManager instance already set");
            return;
        }

        instance = this;
    }
コード例 #18
0
ファイル: AI.cs プロジェクト: clifordunique/Mages-Descent
 public virtual void Start()
 {
     rb2d           = GetComponent <Rigidbody2D>();
     health         = GetComponent <Health>();
     spellIndex     = FindObjectOfType <SpellDatabase>();
     startingPoint  = transform.position;
     anim           = GetComponent <Animator>();
     rm             = FindObjectOfType <RespawnManager>();
     ailmentHandler = GetComponent <AilmentHandler>();
 }
コード例 #19
0
 public void Start()
 {
     spwn = GameManager.managerWasa.RespawnManage;
     GameManager.managerWasa.SetGameStateToMenue();
     GameManager.managerWasa.Audio.StartPlayingNewTrack("MainMenue");
     if (GameManager.managerWasa.GameFinished)
     {
         CreditsDisplay();
     }
 }
コード例 #20
0
    private void Awake()
    {
        instance = this;
        size     = spawnPoints.Length;

        locations = new SpawnLocation[size];
        for (int i = 0; i < size; i++)
        {
            locations[i] = new SpawnLocation(spawnPoints[i]);
        }
    }
コード例 #21
0
 void RecipiePassed()
 {
     messageText.DisplayMessage(victoryStrings[Random.Range(0, victoryStrings.Length)], currentRecipie.name);
     Instantiate(victoryEffectsPrefab, cauldronSurfaceRenderer.transform.position, Quaternion.identity);
     if (currentRecipie.resultPotionPrefab)
     {
         RespawnManager respawner       = FindObjectOfType <RespawnManager> ();
         GameObject     resultingPotion = (GameObject)Instantiate(currentRecipie.resultPotionPrefab, transform.position, transform.rotation);
         respawner.Respawn(resultingPotion);
     }
     DeselectBook();
 }
コード例 #22
0
ファイル: RespawnManager.cs プロジェクト: jramell/Choice
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
コード例 #23
0
 private void Awake()
 {
     // Set this class as Singleton
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
コード例 #24
0
 void Start()
 {
     playerNlg = GameObject.Find("Player").GetComponent <NLGManager>();
     wBoxEnemy.SetActive(false);
     enemyRgdBdy   = GetComponent <Rigidbody2D>();
     RangeA        = transform.position.x + rangeRadius;
     RangeB        = transform.position.x - rangeRadius;
     SpawnX        = transform.position.x;
     SpawnY        = transform.position.y;
     audioMast     = AudioMaster.instance;
     respawnScript = GameObject.Find("mournerCircle").GetComponent <RespawnManager>();
 }
コード例 #25
0
        public static void Prefix(Intercom __instance)
        {
            if (!SanyaPlugin.Instance.Config.IntercomInformation)
            {
                return;
            }

            int  leftdecont      = (int)Math.Truncate((DecontaminationController.Singleton.DecontaminationPhases[DecontaminationController.Singleton.DecontaminationPhases.Length - 1].TimeTrigger) - Math.Truncate(DecontaminationController.GetServerTime));
            int  leftautowarhead = AlphaWarheadController.Host != null ? (int)Mathf.Clamp(AlphaWarheadController.Host._autoDetonateTime - (AlphaWarheadController.Host._autoDetonateTime - AlphaWarheadController.Host._autoDetonateTimer), 0, AlphaWarheadController.Host._autoDetonateTimer) : -1;
            int  nextRespawn     = (int)Math.Truncate(RespawnManager.CurrentSequence() == RespawnManager.RespawnSequencePhase.RespawnCooldown ? RespawnManager.Singleton._timeForNextSequence - RespawnManager.Singleton._stopwatch.Elapsed.TotalSeconds : 0);
            bool isContain       = PlayerManager.localPlayer.GetComponent <CharacterClassManager>()._lureSpj.allowContain;
            bool isAlreadyUsed   = OneOhSixContainer.used;

            leftdecont = Mathf.Clamp(leftdecont, 0, leftdecont);

            string contentfix = string.Concat(
                $"作戦経過時間 : {RoundSummary.roundTime / 60:00}:{RoundSummary.roundTime % 60:00}\n",
                $"残存SCPオブジェクト : {RoundSummary.singleton.CountTeam(Team.SCP):00}/{RoundSummary.singleton.classlistStart.scps_except_zombies:00}\n",
                $"残存Dクラス職員 : {RoundSummary.singleton.CountTeam(Team.CDP):00}/{RoundSummary.singleton.classlistStart.class_ds:00}\n",
                $"残存研究員 : {RoundSummary.singleton.CountTeam(Team.RSC):00}/{RoundSummary.singleton.classlistStart.scientists:00}\n",
                $"AlphaWarheadのステータス : {(AlphaWarheadOutsitePanel.nukeside.enabled ? "READY" : "DISABLED")}\n",
                $"SCP-106再収容設備:{(isContain ? (isAlreadyUsed ? "使用済み" : "準備完了") : "人員不在")}\n",
                $"軽度収容区画閉鎖まで : {leftdecont / 60:00}:{leftdecont % 60:00}\n",
                $"自動施設爆破開始まで : {leftautowarhead / 60:00}:{leftautowarhead % 60:00}\n",
                $"接近中の部隊突入まで : {nextRespawn / 60:00}:{nextRespawn % 60:00}\n\n"
                );

            if (__instance.Muted)
            {
                contentfix += "アクセスが拒否されました";
            }
            else if (Intercom.AdminSpeaking)
            {
                contentfix += $"施設管理者が放送設備をオーバーライド中";
            }
            else if (__instance.remainingCooldown > 0f)
            {
                contentfix += $"放送設備再起動中 : 残り{Mathf.CeilToInt(__instance.remainingCooldown)}秒";
            }
            else if (__instance.speaker != null)
            {
                contentfix += $"{Player.Get(__instance.speaker).Nickname}が放送中... : 残り{Mathf.CeilToInt(__instance.speechRemainingTime)}秒";
            }
            else
            {
                contentfix += "放送設備準備完了";
            }

            __instance.CustomContent = contentfix;

            return;
        }
コード例 #26
0
 void Awake()
 {
     gc        = this;
     titleText = editorTitleText;
     DontDestroyOnLoad(this);
     dialogueUI     = GetComponentInChildren <DialogueUI>();
     signUI         = GetComponentInChildren <SignUI>();
     pc             = GetComponentInChildren <PlayerController>();
     rm             = GetComponent <RespawnManager>();
     playerFollower = gc.GetComponentInChildren <PlayerFollower>();
     save           = gc.GetComponent <Save>();
     blackoutUI     = GetComponentInChildren <BlackFadeUI>();
 }
コード例 #27
0
    SpriteRenderer spriteRenderer;  // temp

    void Start()
    {
        respawnManager = FindObjectOfType <RespawnManager>();
        spriteRenderer = GetComponent <SpriteRenderer>();
        maxHealth      = BaseMaxHealth;
        health         = BaseMaxHealth;
        isDead         = false;

        if (BaseMaxHealth < 0)
        {
            Debug.LogWarning("Player Base Health is negative.");
        }
    }
コード例 #28
0
    private void OnTriggerEnter(Collider other)
    {
        if (isActive)
        {
            return;
        }

        if (other.CompareTag("Player"))
        {
            RespawnManager manager = FindObjectOfType <RespawnManager>();
            manager.currentPoint = this;
            SetActive();
        }
    }
コード例 #29
0
        private void UpdateRespawnCounter()
        {
            if (!RoundSummary.RoundInProgress() || player.Role != RoleType.Spectator)
            {
                return;
            }

            if (RespawnManager.CurrentSequence() == RespawnManager.RespawnSequencePhase.RespawnCooldown || RespawnManager.CurrentSequence() == RespawnManager.RespawnSequencePhase.PlayingEntryAnimations)
            {
                _respawnCounter = (int)Math.Truncate(RespawnManager.Singleton._timeForNextSequence - RespawnManager.Singleton._stopwatch.Elapsed.TotalSeconds);
            }
            else
            {
                _respawnCounter = 0;
            }
        }
コード例 #30
0
 public virtual void PlayPauseButtonClicked()
 {
     if (!Won)
     {
         MMVibrationManager.Haptic(HapticTypes.Selection);
         if (Player.Alive)
         {
             SetPause(!Paused);
         }
         else
         {
             RespawnManager.RespawnPlayer();
             StartTimer();
         }
     }
 }
コード例 #31
0
ファイル: TankHealth.cs プロジェクト: lvsaxon/StrategyGame
    void Start() {
        currentHealth = startingHealth;
        originRotation = transform.rotation;

        //Shield Amount
        startingShield = startingHealth * 0.75f;
        currShield = startingShield;

        //Health UI Components
        healthImg = healthUI.healthUI;
        shieldImage = healthUI.shieldUI;
        healthCanvas = healthUI.healthCanvas;   

        //GameManager Components
        mainCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<Camera>();
        timer = GameObject.FindGameObjectWithTag("Game Manager").GetComponent<Timer>();
        respawnManager = GameObject.FindGameObjectWithTag("Game Manager").GetComponent<RespawnManager>();
    }
コード例 #32
0
 // Use this for initialization
 void Start()
 {
     PadreScript = GameObject.FindGameObjectWithTag ("SpawnManager").GetComponent<RespawnManager> ();
 }
コード例 #33
0
ファイル: CheckPoint.cs プロジェクト: RingoKam/GameJam2016
 // Use this for initialization
 void Start ()
 {
     respawnManager = FindObjectOfType<RespawnManager>();
 }
コード例 #34
0
ファイル: RespawnManager.cs プロジェクト: parahunter/GunFeast
 void Start()
 {
     _instance = this;
 }
コード例 #35
0
    void Start()
    {
        //Auto Hooks
        currCheckpoint = GameObject.Find("startCP");
        player = FindObjectOfType<MasterController>();
        healthManager = FindObjectOfType<HealthManager>();
        respawnManager = FindObjectOfType<RespawnManager>();
        timerManager = FindObjectOfType<TimerManager>();

        //Game Data
        GameOptionData.currentLevel = Application.loadedLevel;

        //Camera Effects
        mainCamera = FindObjectOfType<Camera>();
        cameraSize = mainCamera.orthographicSize;
        zoomOutDuration = playerRespawnDelay * 0.35f;
        zoomInDuration = playerRespawnDelay;
        if(Application.loadedLevel == 7)
        {
            defaultCameraSize = 7.0f;
        }
        else
        {
            defaultCameraSize = mainCamera.orthographicSize;
        }

        cameraZoomInEffect = false;
        cameraZoomOutEffect = false;

        //Optional HUD Information
        //Enemy Count, XP Gems Remaining
        //levelXPGems = GameObject.FindGameObjectsWithTag("XP Gem");
        //arraySize = GameObject.FindObjectsOfType<EnemyHealthManager>().Length;
        //enemyPositionArray = new Vector3[arraySize];
    }
コード例 #36
0
ファイル: Player.cs プロジェクト: BenDy557/TheFall
	// Use this for initialization
	void Start () {
		m_RespawnManager = GameObject.FindGameObjectWithTag ("RespawnManager").GetComponent<RespawnManager> ();
		if (m_RespawnManager == null) {
			m_LobbySpawn = GameObject.FindGameObjectWithTag ("RespawnManager").GetComponent<LobbySpawn> ();
		}
	}
コード例 #37
0
	void Awake(){
		manager = FindObjectOfType<RespawnManager> ();
	}