void Start() {
		unlocks = GlobalController.save.unlocks;
		rb2d = GetComponent<Rigidbody2D>();
		anim = GetComponent<Animator>();
		options = GlobalController.save.options;
		this.facingRight = false;
        cyanMaterial = Resources.Load<Material>("Shaders/CyanFlash");
		spr = GetComponent<SpriteRenderer>();
        defaultMaterial = GetComponent<SpriteRenderer>().material;
		gunEyes = transform.Find("GunEyes").transform;
		gun = GetComponentInChildren<Gun>();
		interaction = GetComponentInChildren<InteractAppendage>();
		lastSafeOffset = this.transform.position;
		speedLimiter = GetComponent<SpeedLimiter>();
		spriteRenderers = new List<SpriteRenderer>(GetComponentsInChildren<SpriteRenderer>(includeInactive:true));
		combatActives = GetComponentsInChildren<ActiveInCombat>(includeInactive:true);
		diamondShine = Resources.Load("Effects/DiamondShine") as GameObject;
		airAttackTracker = GetComponent<AirAttackTracker>();
		RefreshAirMovement();
		deathEvent = Resources.Load("ScriptableObjects/Events/Player Death") as GameEvent;
		groundCheck = GetComponent<PlayerGroundCheck>();
		groundData = groundCheck.groundData;
		LoadFromSaveData(GlobalController.save);
		EnableTriggers();
	}
Beispiel #2
0
 void Awake()
 {
     groundCheck    = transform.GetComponent <PlayerGroundCheck>();
     inventory      = transform.GetComponent <ItemInventory>();
     inputScript    = transform.GetComponent <InputScript>();
     rigidbody      = transform.GetComponent <Rigidbody2D>();
     topCollider    = transform.GetComponent <BoxCollider2D>();
     spriteAnimator = transform.GetComponent <SpriteAnimator>();
 }
Beispiel #3
0
    void Start()
    {
        box       = GetComponent <BoxCollider2D>();
        rb        = GetComponent <Rigidbody2D>();
        layerMask = 1 << LayerMask.NameToLayer(Layers.Ground);

        player      = GetComponent <PlayerController>();
        groundCheck = GetComponent <PlayerGroundCheck>();
    }
Beispiel #4
0
 private void Start()
 {
     rigidBody2D       = GetComponent <Rigidbody2D>();
     playerGroundCheck = GetComponent <PlayerGroundCheck>();
     currentSpeed      = normalMoveSpeed;
     PlayerStatContainer.Instance.inventoryOpenTrigger += () =>
     {
         bool isInventoryOpen = PlayerStatContainer.Instance.isInventoryOpen;
         canPlayerMove = !isInventoryOpen;
         canPlayerJump = !isInventoryOpen;
     };
 }
Beispiel #5
0
 void Awake()
 {
     groundCheck = transform.GetComponent<PlayerGroundCheck>();
     inventory = transform.GetComponent<ItemInventory>();
     inputScript = transform.GetComponent<InputScript>();
     rigidbody = transform.GetComponent<Rigidbody2D>();
     topCollider = transform.GetComponent<BoxCollider2D>();
     spriteAnimator = transform.GetComponent<SpriteAnimator>();
 }
Beispiel #6
0
 // Use this for initialization
 void Start()
 {
     anim = GetComponent <Animator>();
     rb   = GetComponent <Rigidbody2D>();
     playerGroundCheck = GetComponent <PlayerGroundCheck>();
 }
Beispiel #7
0
 // Start is called before the first frame update
 void Start()
 {
     rb = GetComponent <Rigidbody>();
     playerGroundCheck = GetComponentInChildren <PlayerGroundCheck>();
 }
Beispiel #8
0
 // Use this for initialization
 void Start()
 {
     rb = GetComponent <Rigidbody2D>();
     playerGroundCheck = GetComponent <PlayerGroundCheck>();
 }
Beispiel #9
0
 public void Awake()
 {
     rb            = GetComponent <Rigidbody2D>();
     fistAttack    = GetComponent <FistAttack>();
     groundChecker = GetComponentInChildren <PlayerGroundCheck>();
 }
Beispiel #10
0
 // Use this for initialization
 void Awake()
 {
     pm             = this.gameObject.GetComponent <PlayerMovement>();
     gc             = this.gameObject.GetComponent <PlayerGroundCheck>();
     spriteAnimator = this.gameObject.GetComponent <SpriteAnimator>();
 }
Beispiel #11
0
 // Use this for initialization
 void Awake()
 {
     pm = this.gameObject.GetComponent<PlayerMovement>();
     gc = this.gameObject.GetComponent<PlayerGroundCheck>();
     spriteAnimator = this.gameObject.GetComponent<SpriteAnimator>();
 }