void Awake() { colliderUp = transform.GetChild(0).GetComponent <CheckCollider>(); colliderRight = transform.GetChild(1).GetComponent <CheckCollider>(); colliderDown = transform.GetChild(2).GetComponent <CheckCollider>(); colliderLeft = transform.GetChild(3).GetComponent <CheckCollider>(); }
//public bool crawl = false; void Awake() { knifeCollider.gameObject.SetActive(false); pv = GetComponent <PhotonView>(); if (pv.isMine) { //rader.playerPos = tr; ps = GetComponent <PlayerState>(); sbm = GetComponentInChildren <StateBarManager>(); rb = GetComponent <Rigidbody>(); om = GetComponent <OptionManager>(); fs = GetComponent <FireScript>(); cc = GetComponent <CheckCollider>(); Camera.main.GetComponent <CameraControl>().Player = this.gameObject; Camera.main.GetComponent <CameraControl>().enabled = true; } else { //anim = null; scopeOverlay = null; cameraTransform = null; camPivot = null; //rb.isKinematic = true; //this.enabled = false; } }
void Awake() { pv = GetComponent <PhotonView>(); camCon = Camera.main.GetComponent <CameraControl>(); optionManager = GetComponent <OptionManager>(); charMove = GetComponent <CharacterMove>(); fireScript = GetComponent <FireScript>(); currHp = Constants.initHp; renderers = GetComponentsInChildren <MeshRenderer>(); skinRenderers = GetComponentsInChildren <SkinnedMeshRenderer>(); colliders = GetComponentsInChildren <Collider>(); canvas = GetComponentsInChildren <Canvas>(); checkColliderCs = GetComponent <CheckCollider>(); sbm = GetComponentInChildren <StateBarManager>(); if (!pv.isMine) { otherUIobj.SetActive(false); gameOverUIobj.SetActive(false); deathCamPivot.SetActive(false); } }
void Check(CustomCollider tCollider1, CustomCollider tCollider2) { ColliderType type1 = tCollider1.Type; ColliderType type2 = tCollider2.Type; bool result = false; switch (type1) { case ColliderType.Circle: switch (type2) { case ColliderType.Circle: result = CheckCollider.CheckCircleAndCircle(tCollider1 as CustomCircleCollider, tCollider2 as CustomCircleCollider); break; case ColliderType.Polygon: case ColliderType.Rectangle: result = CheckCollider.CheckPolygonAndCircle(tCollider2 as CustomPolygonCollider, tCollider1 as CustomCircleCollider); break; } break; case ColliderType.Polygon: case ColliderType.Rectangle: switch (type2) { case ColliderType.Circle: result = CheckCollider.CheckPolygonAndCircle(tCollider1 as CustomPolygonCollider, tCollider2 as CustomCircleCollider); break; case ColliderType.Polygon: case ColliderType.Rectangle: result = CheckCollider.CheckPolygonAndPolygon(tCollider1 as CustomPolygonCollider, tCollider2 as CustomPolygonCollider); break; } break; } }