void Start() { graceFrames = maxGraceFrames; sprite = transform.Find("AtlasSprite"); spriteController = sprite.GetComponent <atlasSpriteController>(); anim = GetComponentInChildren <Animator>(); deformer = GetComponentInChildren <Deformer>(); controller = GetComponent <characterController>(); particleMaker = GetComponent <particleMaker>(); boxCollider = GetComponent <BoxCollider2D>(); steps = GetComponentInChildren <stepSounds>(); hanger = transform.Find("AtlasSprite/Hanger"); colliderStartSize = boxCollider.size; colliderStartOffset = boxCollider.offset; sortingOrder = sprite.GetComponent <SpriteRenderer>().sortingOrder; gravity = gameManager.Instance.gravity; //-(2 * jumpHeight) / Mathf.Pow(timeToJumpApex, 2); jumpVelocity = Mathf.Abs(gravity) * timeToJumpApex; float djgravity = -(2 * doubleJumpHeight) / Mathf.Pow(timeToJumpApex, 2); doubleJumpVelocity = Mathf.Abs(djgravity) * timeToDoubleJumpApex; setLastSafePosition(); warpToCurrentDoor(); if (created) { Destroy(gameObject); } created = true; DontDestroyOnLoad(gameObject); }
private void Awake() { pMaker = pManagerGameObject.GetComponent <particleMaker>(); bnw = BrainGameObject.GetComponent <BrainNetWork>(); _pSender = new pSender[bnw.MaxSignalNumber]; for (int i = 0; i < _pSender.Length; ++i) { _pSender[i] = new pSender(); _pSender[i].active = false; } }
public ParticleSender(Vector3 fpos, Vector3 tpos, int pIn, float limi_time, Cell tcell, Axon faxon, particleMaker pm) { fromPoint = fpos; toPoint = tpos; particleIndex = pIn; limitTime = limi_time; startTime = Time.time; targetCell = tcell; fromAxon = faxon; pMaker = pm; active = true; }